
SM-Applications Modules & Motion Processors User Guide
79
Issue Number: 4
S
Info
rm
In
Inst
al
G
Pa
ra
DP
L
Pr
Co
m
F
CT
S
In
S
D
M
Q
In
7.2
Tasks
A DPL program is separated into separate sections called tasks. Within the tasks a user
writes the program instructions that will be executed by the microprocessor under
certain conditions or on a particular time-base. Each task has a particular name,
purpose and priority and only one of each task can be present in the DPL program. The
common tasks are outlined below:
All program instructions
must
live within a task. For time-based tasks like POS0, POS1
and CLOCK the instructions within the task have only a finite time in which to complete,
therefore only time critical functions should be performed within them.
The position tasks consist of POS0, APC and POS1 and are executed in this order, if
applicable (i.e. if they are set to run).
Table 7-1 Common Tasks
Task Name
Priority
Purpose
INITIAL
2
The very first task that is run after a power-up or reset. This task is
commonly used to initialise drive parameters and program variables.
Only the ERROR task can run before this task is completed.
BACKGROUND
6
Low priority task used to do non-time critical functions. This task
closely resembles the scan loop of a PLC in the way that it works. It
is usual that this task section is created as one big loop, with a
command at the end of the task to jump back to the start. If the task
is allowed to finish, it will not execute again.
CLOCK
5
Task executed on a fixed timebase (between 1-200 ms) used for
some time related operations, for example to generate a ramp
profile. This task is now synchronised to the drive’s level 2 control
loop and can be used in place of the old Encoder task.
POS0
POS1
4
Two real-time tasks that run synchronously to a multiple of the drive
control loops (range from 250
µs
to 8 ms). These tasks are
commonly used to control the drive speed and/or current loop in
applications such as positioning. The POS0 task is first to run,
followed immediately after by the POS1 task.
EVENT
3
Event tasks only run when a certain event occurs. Events can be
raised from various sources such as CTNet, other option modules in
the drive or the user program and usually only have a very small
number of instructions. They can be likened to interrupt service
routines.
EVENT1
3
See above description.
EVENT2
3
See above description.
EVENT3
3
See above description.
ERROR
1
A task that runs only when a run-time error occurs within the user
DPL program (for example a divide by zero). This can be used to
safely handle abnormal program behaviour situations. All other tasks
will be halted prior to the ERROR task running.
When using the CLOCK, POS0 and POS1 tasks, it is advisable to avoid using code such
as the FOR and DO WHILE loops. This may cause a DPL over-run error (tr54).
The UD70 ENCODER and SPEED tasks can still be used. These are now aliases for the
POS0 and POS1 tasks respectively (i.e. if the program has an ENCODER task this is the
same as if it contained a POS0 task) The timebase for both tasks are not fixed as in the
UD70 but specified by the user. The CLOCK task in the Second Processor can be used
in place of the ENCODER task in the UD70, thus giving a timebase closer to that of the
UD70 ENCODER task than is available with the POS0 and POS1 tasks.
NOTE
NOTE
Summary of Contents for Digitax ST Indexer
Page 131: ......
Page 132: ...0471 0062 04...