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
Содержание SIMATIC S5-100U
Страница 6: ...EWA 4NEB 812 6120 02b ...
Страница 16: ...EWA 4NEB 812 6120 02b ...
Страница 21: ...1 The SIMATIC S5 System Family EWA 4NEB 812 6120 02b ...
Страница 22: ...Figures 1 1 Members of the SIMATIC S5 System Family 1 1 EWA 4NEB 812 6120 02b ...
Страница 23: ......
Страница 27: ......
Страница 36: ...EWA 4NEB 812 6120 02b ...
Страница 40: ......
Страница 41: ......
Страница 42: ......
Страница 43: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 102: ...EWA 4NEB 812 6120 02b ...
Страница 156: ...EWA 4NEB 812 6120 02b ...
Страница 232: ...EWA 4NEB 812 6120 02b ...
Страница 268: ...EWA 4NEB 812 6120 02b ...
Страница 272: ...EWA 4NEB 812 6120 02b ...
Страница 336: ...EWA 4NEB 812 6120 02b ...
Страница 352: ...EWA 4NEB 812 6120 02b ...
Страница 412: ...EWA 4NEB 812 6120 02b ...
Страница 482: ...EWA 4NEB 812 6120 02b ...
Страница 484: ...EWA 4NEB 812 6120 02b ...
Страница 505: ...B Dimension Drawings EWA 4NEB 812 6120 02b ...
Страница 515: ...C Active and Passive Faults in Automation Equipment EWA 4NEB 812 6120 02b ...
Страница 516: ...EWA 4NEB 812 6120 02b ...
Страница 522: ...EWA 4NEB 812 6120 02b ...
Страница 523: ...D Information for Ordering Accessories EWA 4NEB 812 6120 02b ...
Страница 524: ...EWA 4NEB 812 6120 02b ...
Страница 530: ...EWA 4NEB 812 6120 02b ...
Страница 531: ...E Reference Materials EWA 4NEB 812 6120 02b ...
Страница 532: ...EWA 4NEB 812 6120 02b ...
Страница 534: ...EWA 4NEB 812 6120 02b ...
Страница 535: ...F Siemens Addresses Worldwide EWA 4NEB 812 6120 02b ...
Страница 536: ...EWA 4NEB 812 6120 02b ...
Страница 542: ...EWA 4NEB 812 6120 02b ...
Страница 543: ...Index EWA 4NEB 812 6120 02b ...
Страница 544: ...EWA 4NEB 812 6120 02b ...
Страница 550: ...EWA 4NEB 812 6120 02b ...