Engineering via SICAM WEB
428 Unrestricted SICAM A8000 / CP-8000 • CP-8021 • CP-8022 Manual
DC8-037-2.02, Edition 10.2017
Example:
LD M_DINT_COMPARE (*load flag*)
ST EQ.IN0 (*store at input 0 for equal function*)
LD 3 (*load value 3*)
ST EQ.IN1 (*store at input 1 for equal function*)
CAL EQ (*call function*)
ST O_030_008_000_000.VALUE (*if both values are equal the output of
the function is set to 1*)
If a comparison of two values is performed, the output is set if the flag M_DINT_COMPARE is
written with 3 (the writing of the flag is not included here).
Note
When linking inputs of the following functions with „constant values“ the type-safe call CAL is to be used:
ADD, SUB, MUL, MUL, DIV, GT, GE, EQ, NE, LE, LT (with the respective type specificities).
All binary functions (AND, XOR, …) are automatically BOOL and hence do not need to be provided with a
CAL.
When creating an IL, at the listed functions BOOL must be linked as constant with 0 and 1, numerical
constant of the value 1 and 0 with 00 or 01, since the runtime currently does not support a differentiating +
(however, a leading 0).
9.2.1.2.5 Call of Function Blocks
Function blocks do not have any temporary variables. Each new (derived) function block oc-
cupies a new memory in the RAM.
Respectively the first result of the function block is written in the accumulator. If a function
block has more than one result, then this can be accessed as with the parameter transfer.
Example:
LD 1
ST CTU_TEST.CU
ST CTU_TEST.R
LD 5
ST CTU_TEST.PV
CAL CTU_TEST
LD CTU_TEST.CV (*access to 2nd result*)