Decrement/Increment - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

STEP 5 Operations
STL
L
IW 12
Load the contents of input word IW 12 into ACCUM 1.
CSW
Invert all bits. Add a "1" at the least significant position.
T
DW 100
Transfer the altered word to data word DW 100.
15
ACCUM 1
0 1 0 1 1 0 0 1
15
ACCUM 1
1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 1
3.2.7

Decrement/Increment

The decrement/increment operations change the data loaded into ACCUM 1. Table 3-17 provides
an overview of the decrement/increment operations. An example follows the table.
Operation
Operand
D
I
Processing
Execution of the decrement and increment operations is independent of the RLO and does not
affect the RLO or the condition codes.
The parameter indicates the value by which the contents of ACCUM 1 are to be changed. The
operations refer to decimal values; however, the result is stored in ACCUM 1 in binary form.
Changes relate only to the low byte in the accumulator.
3-52
Numeric Example
IW 12
1 1 0 0 0 1 0 1
+1
CSW
0
Table 3-17. Decrement/Increment Operations
Decrement
Decrement the contents of the accumulator.
Increment
Increment the contents of the accumulator.
The contents of ACCUM 1 are either decremented or incremented
by the number indicated in the parameter.
Execution of the operation is unconditional and is limited to the
right-hand byte (without carry).
Parameter
0 to 255
Explanation
Form the negative value of the
0
value in input word IW 12.
Meaning
S5-115F Manual
EWA 4NEB 811 6149-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents