Comparison instructions
608
Part III FP Instructions
F62_WIN
16-bit data band compare
Flags
Comparison between
s1, s2 and s3
R900A (>flag) R900B
(=flag)
R900C (<flag)
s1_In < s2_Min Off Off On
s2_Min s1_In
s3_Max
Off On Off
s1_In > s3 On Off Off
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
PLC types
Availability of F62_WIN (see page 1325)
Variable Data type Function
s1_In 16-bit area or 16-bit equivalent constant to be compared
s2_Min lower limit, 16-bit area or 16-bit equivalent constant
s3_Max
ANY16
upper limit, 16-bit area or 16-bit equivalent constant
The variables s1, s2 and s3 have to be of the same data type.
For Relay T/C Register Constant
s1, s2, s3 WX WY WR WL SV EV DT LD FL dec. or hex.
Description
Compares the 16-bit equivalent constant or 16-bit data specified by s1_In with the data band
specified by s2_Min and s3_Max if the trigger EN is in the ON-state. This instruction checks that
s1_In is in the data band between s2_Min (lower limit) and s3_Max (higher limit), larger than
s3_Max, or smaller than s2_Min. The compare operation considers +/- sign. Since the BCD data is
also treated as 16-bit data with sign, we recommend using BCD data within the range of 0 to 7999
to avoid confusion. The compare operation result is stored in special internal relays R9009, R900A
to R900C.
Data types
Operands
Example
In this example, the same POU header is used for all programming languages. For an example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.