Decrement/Increment, For Cpu 103 And Higher - Siemens SIMATIC S5-100U System Manual

Simatic s5 series cpu 100/102/103
Hide thumbs Also See for SIMATIC S5-100U:
Table of Contents

Advertisement

STEP 5 Operations
8.2.7

Decrement/Increment, for CPU 103 and Higher

The decrement/increment operations change the data loaded into ACCU 1. Table 8-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 ACCU 1 are to be changed.
The operations refer to decimal values; however, the result is stored in ACCU 1 in binary form.
Changes relate only to the low byte in the accumulator.
Example
Increment the hexadecimal constant
1010
by 16 and store the result in
H
data word DW8.
In addition, decrement the incremen-
tation result by 33 and store the new
result in data word DW9.
8-52
Table 8-17. Decrement/Increment Operations
Decrement
Decrement the contents of the accumulator.
Increment
Increment the contents of the accumulator.
The contents of ACCU 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
STL
C
L
I
T
D
T
Meaning
Explanation
Call data block DB6.
DB
6
Load hexadecimal constant 1010
KH
1010
into ACCU 1.
Increment the low byte of ACCU 1
16
by 16. The result, 1020
located in ACCU 1.
Transfer the contents of ACCU 1
DW
8
(1020
) to data word DW8. Since
H
the incrementation result is still in
ACCU 1, you can decrement by 33
directly.
The result would be FFF
33
However, since the high byte of
ACCU 1 is not decremented along
with the low byte, the result in
ACCU 1 is 10FF
The contents of ACCU 1 are
DW
9
transferred to DW9 (10FF
S5-100U
H
, is
H
.
H
.
H
).
H
EWA 4NEB 812 6120-02b

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents