78 SM-Applications Modules & Motion Processors User Guide
Issue Number: 4
7 DPL Programming
This chapter covers:
• Basic DPL program structure and syntax
• Basic DPL commands
• New features offered by the Second Processor
7.1 Program Header
Every DPL program starts with a header section. SyPTPro creates this section for the
user. It basically consists of:
• Program title
• Program author
• Program version number
7.1.1 Aliases
Immediately below the header the user may enter a section of aliases. Aliases are used
to 'replace' various expressions or constants:
• a numerical constant expression
• the address of a register or parameter
• a DPL expression or statement
Aliases are created with the $DEFINE statement.
For example it is good practice to use aliases to give names to all drive parameters
used in a program.
It is also recommended to have the alias name in UPPER-case letters in order to help
distinguish them from normal variables.
The full reference for all DPL commands and function blocks is provided by the on-line
help guides.
$DEFINE
name value
$DEFINE PRESET_REF_1 #1.21
$DEFINE PRESET_REF_2 #1.22
$DEFINE SPEED_FB #3.02
It is recommended that aliases representing integer values have a '%' symbol appended
to the alias name. In graphical programming tools (QLD/FBD), SyPTPro will treat all
aliases without a % symbol as floating-point values. Hence they will be rejected on LD
or integer only inputs.
The $DEFINE directive does NOT produce any code, nor does it speed up the execution
time of your program - it simply allows you to refer to something with a different name.