Arithmetic Operation - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

STEP 5 Operations
3.3.3

Arithmetic Operation

Arithmetic operations increase the contents of ACCUM 1 by a specified value. The parameter
represents this value as a positive or negative number. Table 3-28 shows the essential features of
the "ADD" operation. An example follows the table.
Operation
Operand
ADD
ID
BF
KF
Processing
An arithmetic operation is executed independently of the RLO. It does not affect the RLO or the
condition codes.
You can subtract by entering a negative parameter.
Even if the result cannot be represented by 16 bits, no carry is made to ACCUM 2, i.e. the contents
of ACCUM 2 are not changed.
Example
Decrement the constant 1020
and store the result in flag word
FW 28. Afterwards add the constant
256 to the result and store the sum in
flag word FW 30.
3-68
Table 3-28. Overview of the "ADD" Operation
Add a constant.
Add byte or word constants.
Parameter
-128 to +127
-32768 to +32767
by 33
L
H
ADD BF
T
ADD KF
T
Meaning
STL
KH 1020
The constant 1020
ACCUM 1.
-33
The constant -33
the ACCUM contents.
FW 28
The new ACCUM contents
(0FFF
) are stored in flag word
H
FW 28.
256
The constant 256
the last result.
FW 30
The new ACCUM contents
(10FF
) are stored in flag word
H
FW 30.
S5-115F Manual
Explanation
is loaded into
H
is added to
10
is added to
10
EWA 4NEB 811 6149-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents