Comparison Operations - Siemens SIMATIC S5-115U User Manual

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

STEP 5 Operations

8.1.6 Comparison Operations

Comparison operations compare the contents of the two accumulators. The comparison does not
change the accumulators' contents. Table 8-6 provides an overview of the comparison operations.
An example follows the table.
Operation
Operand
! =
F
> <
F
>
F
> =
F
<
F
< =
F
Processing Comparison Operations
To compare two operands, load them consecutively into the two accumulators. Execution of the
operations is independent of the RLO.
The result is binary and is available as RLO for further program scanning. If the comparison is
satisfied, the RLO is "1". Otherwise it is "0".
Executing the comparison operations sets the condition codes (see Section 8.4).
Note
When using comparison operations, make sure the operands have the same number
format.
8-30
Table 8-6. Overview of Comparison Operations
Compare for "equal to"
The contents of the two accumulators are interpreted as bit
patterns and scanned to see if they are equal.
Compare for "not equal to"
The contents of the two accumulators are interpreted as bit
patterns and compared to see if they are not equal.
Compare for "greater than"
The contents of the two accumulators are interpreted as fixed-
point numbers. They are compared to see if the operand in
ACCUM 2 is greater than the operand in ACCUM 1.
Compare for "greater than or equal to"
The contents of the two accumulators are interpreted as fixed-
point numbers. They are compared to see if the operand in
ACCUM 2 is greater than or equal to the operand in ACCUM 1.
Compare for "less than"
The contents of the two accumulators are interpreted as fixed-
point numbers. They are compared to see if the operand in
ACCUM 2 is less than the operand in ACCUM 1.
Compare for "less than or equal to"
The contents of the two accumulators are interpreted as fixed-
point numbers. They are compared to see if the operand in
ACCUM 2 is less than or equal to the operand in ACCUM 1.
S5-115U Manual
Meaning
EWA 4NEB 811 6130-02b

Advertisement

Table of Contents
loading

Table of Contents