
SM-Applications Modules & Motion Processors User Guide
121
Issue Number: 4
S
Info
rm
In
Inst
al
G
Pa
ra
DP
L
Pr
Communica
F
CT
Sy
nc
In
Sy
nc
D
Migra
Q
Ind
ex
12.3
General Features
12.3.1 DPL Language
DPL remains backwardly compatible. The following enhancements have been made
though:
•
Addition of new constructs such as FOR...LOOP and SELECT...CASE.
•
Nesting: The stack size is now allocated on a per-task basis and is larger than that
of the UD70, so more nesting is allowed.
•
New data type of single-precision floating point has been added that offers a small
execution time advantage over double-precision (which remain the default). Single
or double precision is specified as a global program option using the new $FLT
SINGLE directive in the program header.
12.3.2 Maths
•
Expression complexity is now greatly improved in that on the UD70 you were limited
to how much you could do in one expression. Now you can create expressions with
much greater complexity.
•
A new casting operator TRUNC has been added. This provides a float to integer
conversion, truncating rather than rounding the result.
•
Floating point comparison: With the UD70 a rather imprecise and unpredictable
fuzzy compare was used for comparing floating point values. Now the SM-
Applications Modules & Motion Processors uses a standard comparison method, as
used in other programming languages, that is not fuzzy. However this may lead to a
unexpected side effect. For example,
If checking for equality or not equality, use a range. For example:
12.3.3 Tasks
The tasks have been changed.
•
The ENCODER and SPEED tasks are no longer used. Instead the POS0 and POS1
tasks have been added. Also, the CLOCK task can be used as a replacement for
the ENCODER task. The POS0, POS1 and CLOCK tasks run synchronously to the
drive (like the SPEED task did), but you can now specify a multiple of that time -
from 250 µs to 8 ms for the POS0 and POS1 and 5 ms to 200 ms for the CLOCK
task. Users may still use the names ENCODER and SPEED since they are aliases
The single-precision data type is not a direct replacement for double-precision and users
should make sure that the single precision type offers sufficient precision for their
application.
NOTE
f = 1.2 * 3
IF f = 3.6 THEN
// This would not yield true.
ENDIF
f = 1.2 * 3
IF f > 3.59 or f < 3.61 THEN
// This would yield true.
ENDIF
Содержание Digitax ST Indexer
Страница 131: ......
Страница 132: ...0471 0062 04...