Addressing Of Flags; Call Of Functions - Siemens SICAM CMIC User Manual

Remote terminal units
Table of Contents

Advertisement

Engineering via SICAM WEB

5.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.

5.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 or-
der 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
ST
SQRT.IN0
CAL
SQRT
ST
ADD.IN0
tion*)
LD
17
ST
ADD.IN1
CAL
ADD
ST
M_DINT_RESULT
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.
242
(*load value 9 into the accumulator*)
(*store at input for square root function*)
(*call function*)
(*store result from*)
(*square root function at input 0 for ADD func-
(*load value 17 into the accumulator*)
(*store at input 1 for ADD function*)
(*call function*)
(*store result in a flag*)
SICAM RTUs, User Manual SICAM CMIC
DC8-001-2.09, Edition 08.2016

Advertisement

Table of Contents
loading

Table of Contents