Engineering via SICAM WEB
SICAM A8000 / CP-8000 • CP-8021 • CP-8022 Manual
Unrestricted
427
DC8-037-2.02, Edition 10.2017
9.2.1.2.3 Addressing of Flags
A flag is assigned by an
ST
operation and the address of the operand. The value of a flag is
written by an
LD
operation and the address of the operand.
The number format must be chosen according to the format of the value to be stored.
Example:
LD I_030_002_000_000.VALUE
ST M_BOOL_FLAG00
Note
At startup all flags which are not signed as "retain" are initialized with
0
.
9.2.1.2.4 Call of Functions
Functions have only temporary variables, therefore with each call all necessary call parame-
ters must be set. Not used call parameters do not affect the result on execution of the func-
tion.
Example: If an addition (
ADD
) of 3 values is performed, then the inputs
IN0
,
IN1
,
IN2
are
used. The remaining inputs are automatically set to
0
.
The writing of inputs of a function must always begin with
IN0
and take place in ascending
order without gaps.
The call parameters must be interchanged with a combination of
LD
and
ST
.
The name of the call parameter is produced from the name of the function and the name of
the parameter separated by a "
.
".
Example:
LD 9
(*load value 9 into the accumulator*)
ST SQRT.IN0
(*store at input for square root function*)
CAL SQRT
(*call function*)
ST ADD.IN0
(*store result from*)
(*square root function at input 0 for ADD func-
tion*)
LD 17
(*load value 17 into the accumulator*)
ST ADD.IN1
(*store at input 1 for ADD function*)
CAL ADD
(*call function*)
ST M_DINT_RESULT
(*store result in a flag*)
The results of the respective functions are written in the accumulator. In the example the value
is also stored on the flag
M_DINT_RESULT
.
After the call of a function (
CAL
) all inputs of the respective function are set to the default val-
ues again.
Summary of Contents for CP-8000
Page 604: ......