STEP 5 Operations
S5-100U
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.
Table 8-17. Decrement/Increment Operations
Operation
Meaning
Parameter
0 to 255
Operand
D
I
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).
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.
Explanation
Call data block DB6.
Load hexadecimal constant 1010
H
into ACCU 1.
Increment the low byte of ACCU 1
by 16. The result, 1020
H
, is
located in ACCU 1.
Transfer the contents of ACCU 1
(1020
H
) to data word DW8. Since
the incrementation result is still in
ACCU 1, you can decrement by 33
directly.
The result would be FFF
H
.
However, since the high byte of
ACCU 1 is not decremented along
with the low byte, the result in
ACCU 1 is 10FF
H
.
The contents of ACCU 1 are
transferred to DW9 (10FF
H
).
STL
Example
Increment the hexadecimal constant
1010
H
by 16 and store the result in
data word DW8.
In addition, decrement the incremen-
tation result by 33 and store the new
result in data word DW9.
C
DB
6
L
KH
1010
I
16
T
DW
8
D
33
T
DW
9
8-52
EWA 4NEB 812 6120-02b
Summary of Contents for SIMATIC S5-100U
Page 6: ...EWA 4NEB 812 6120 02b ...
Page 16: ...EWA 4NEB 812 6120 02b ...
Page 21: ...1 The SIMATIC S5 System Family EWA 4NEB 812 6120 02b ...
Page 22: ...Figures 1 1 Members of the SIMATIC S5 System Family 1 1 EWA 4NEB 812 6120 02b ...
Page 23: ......
Page 27: ......
Page 36: ...EWA 4NEB 812 6120 02b ...
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 102: ...EWA 4NEB 812 6120 02b ...
Page 156: ...EWA 4NEB 812 6120 02b ...
Page 232: ...EWA 4NEB 812 6120 02b ...
Page 268: ...EWA 4NEB 812 6120 02b ...
Page 272: ...EWA 4NEB 812 6120 02b ...
Page 336: ...EWA 4NEB 812 6120 02b ...
Page 352: ...EWA 4NEB 812 6120 02b ...
Page 412: ...EWA 4NEB 812 6120 02b ...
Page 482: ...EWA 4NEB 812 6120 02b ...
Page 484: ...EWA 4NEB 812 6120 02b ...
Page 505: ...B Dimension Drawings EWA 4NEB 812 6120 02b ...
Page 515: ...C Active and Passive Faults in Automation Equipment EWA 4NEB 812 6120 02b ...
Page 516: ...EWA 4NEB 812 6120 02b ...
Page 522: ...EWA 4NEB 812 6120 02b ...
Page 523: ...D Information for Ordering Accessories EWA 4NEB 812 6120 02b ...
Page 524: ...EWA 4NEB 812 6120 02b ...
Page 530: ...EWA 4NEB 812 6120 02b ...
Page 531: ...E Reference Materials EWA 4NEB 812 6120 02b ...
Page 532: ...EWA 4NEB 812 6120 02b ...
Page 534: ...EWA 4NEB 812 6120 02b ...
Page 535: ...F Siemens Addresses Worldwide EWA 4NEB 812 6120 02b ...
Page 536: ...EWA 4NEB 812 6120 02b ...
Page 542: ...EWA 4NEB 812 6120 02b ...
Page 543: ...Index EWA 4NEB 812 6120 02b ...
Page 544: ...EWA 4NEB 812 6120 02b ...
Page 550: ...EWA 4NEB 812 6120 02b ...