Digital Logic Operations - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

STEP 5 Operations
3.2.4

Digital Logic Operations

Digital logic operations combine the contents of both accumulators logically bit by bit. Table 3-14
provides an overview of these digital logic operations. Examples follow the table.
Operation
Operand
AW
OW
XOW
Processing a digital logic operation
A digital logic operation is executed regardless of the RLO. It also does not affect the RLO.
However, it sets condition codes according to the result of the arithmetic operation ( 3.4).
Note
Make sure that both operands have the same number format. Then load them into the
accumulators before executing the operation.
The result of the arithmetic operation is available in ACCUM 1 for further processing. The contents
of ACCUM 2 are not affected.
STL
L
IW 92
Load input word IW 92 into ACCUM 1.
L
KH 00FF
Load a constant into ACCUM 1. The previous contents of ACCUM 1 are
shifted to ACCUM 2.
AW
Combine the contents of both accumulators bit by bit through logic AND.
T
QW 82
Transfer the resulting contents from ACCUM 1 to output word QW 82.
15
0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0
ACCUM 2
ACCUM 1
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
ACCUM 1
0 0 0 0 0 0 0 0
3-46
Table 3-14. Overview of Digital Logic Operations
Combine bit by bit through logic AND.
Combine bit by bit through logic OR.
Combine bit by bit through EXCLUSIVE OR.
Numeric Example
IW 90
KH 00FF
Result
1 0 0 1 1 1 0 0
Meaning
Explanation
Set the 8 high-order bits in input
0
word IW 90 to "0".
Compare both words bit by bit. If
corresponding bits are both "1", the
AND
result bit is set to "1".
S5-115F Manual
EWA 4NEB 811 6149-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents