MD29
Issue code: 29nu4
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
$VERSIO N number. The number can have a maximum
of eight characters. The recommended format is $VERSI ON 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 Mentor
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 different
types of Drive, the name of the Drive must be stated.) The list of
suffixes are as follows:
•
MENTOR
• CDE750 (bookcase CDE)
• CDE7500 (large CDE and HPCDE)
• VECTOR
$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
BACKGROU N D 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.