Comparison instructions
610
Part III FP Instructions
F63_DWIN
32-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 F63_DWIN (see page 1326)
Variable Data type Function
s1_In 32-bit area or 32-bit equivalent constant to be compared
s2_Min lower limit, 32-bit area or 32-bit equivalent constant
s3_Max
ANY32
upper limit, 32-bit area or 32-bit equivalent constant
The variables s1, s2 and s3 have to be of the same data type.
For Relay T/C Register Constant
s1_In,
s2_Min,
s3_Max
DWX DWY DWR DWL DSV DEV DDT DLD DFL dec. or hex.
Description
Compares the 32-bit equivalent constant or 32-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 32-bit data with sign, we recommend using BCD data within the range of 0 to
79999999 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 function has been programmed in ladder diagram (LD) and structured text
(ST).The same POU header is used for all programming languages.