Chapter 4. Ladder Diagram (LD) Programming
212
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
4.12.1
Compare
When the Compare (CMP) function receives power flow, it compares
the value IN1 to the value IN2.
■
If IN1 < IN2, CMP energizes the LT (Less Than) output.
■
If IN1 = IN2, CMP energizes the EQ (Equal) output.
■
If IN1 > IN2, CMP energizes the GT (Greater Than) output.
Mnemonics:
CMP_DINT
CMP_INT
CMP_REAL
CMP_LREAL
CMP_UINT
IN1 and IN2 must be the same data type.
CMP compares data of the following types: DINT, INT, REAL, LREAL, and UINT.
Tip:
To compare values of different data types, first use conversion functions to make the types
the same.
When it receives power flow, CMP always passes power flow to the right, unless IN1 and/or IN2 is
NaN (Not a Number).
Operands
Parameter
Description
Allowed Operands
Optional
IN1
The first value to compare.
All except S, SA, SB, SC
No
IN2
The second value to compare.
All except S, SA, SB, SC
No
LT
Output LT is energized when I1 < I2.
Power flow
No
EQ
Output EQ is energized when I1 = I2.
Power flow
No
GT
Output GT is energized when I1 > I2.
Power flow
No
Example
When %I00001 is ON, the integer variable SHIPS is compared
with the variable BOATS. Internal coils %M0001, %M0002, and
%M0003 are set to the results of the compare.
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...