UD70
Issue code: 70nu2
Getting started 3-3
Explanation of the example program
$TITLE Sawtooth
The first line of a program must be
$TITLE program name. The name
can have a maximum of 64 characters.
$VERSION 1.1.1
The second line is
$VERSION number. The number can have a maximum
of eight characters. The recommended format is $VERSION 1.0.0.
Updates are easily shown by increasing the last number, eg. 1.0.11.0.1.
Major modifications are shown by 2.0.02.0.0, 3.00 3.00, etc.
$DRIVE Unidrive
The third line is
$DRIVE drive name. This tells the compiler which Drive
it is installed in. (Since the DPL Toolkit can be used with the UD70 and
the MD29, this must be stated.)
$AUTHOR MyName
$COMPANY MyCo
The fourth and fifth lines are used to define the author of the program
and the company name.
Note
Unless these lines are included, the program will not be
compiled.
//Note: This is a comment.
The program ignores comment lines which can be placed anywhere in a
program. Comments are always preceded by either a double forward
slash [////] or a semi colon[;].
Comments are useful for inserting descriptions, or for giving
explanations for the benefit of the user or programmer.
BACKGROUND{
BACKGROUND is a type of Task. (All executable code must be
contained within a Task.) There are many different types of Task,
which, in effect, define the priority of the code and allow blocks of
code to be run on different time-bases.
The
BACKGROUND task is a free-running task which can be compared to
the way a PLC runs a program, for example. Full details of the Tasks are
given in Real-time programming in Chapter 4 DPL Programming.
Top:
Top:Top: is a label which marks an absolute position in the program. A label
must always be followed by a colon [::].
A label defines the destination of a
GOTO statement. It can be given
any name (eg. mylabelmylabel).
#1.21=0
A hash (##) expression accesses Drive parameters. In this case the
parameter is 1.21 (menu 1, parameter 21). This is a preset speed
reference parameter in the Unidrive, and it is set at zero.