FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
6-1
6: D
ATA
C
OMPARISON
I
NSTRUCTIONS
Introduction
Data can be compared using data comparison instructions, such as equal to, unequal to, less than, greater than, less than or equal
to, and greater than or equal to. When the comparison result is true, an output or internal relay is turned on. The repeat operation
can also be used to compare more than one set of data.
When the repeat operation is enabled, repeated comparison results of CMP instructions can be selected from AND or OR operation,
and the result is outputted to an output or internal relay.
Three values can also be compared using the ICMP>= instruction.
Load comparison instructions load comparison results so that the following instructions can be initiated.
Since the data comparison instructions are executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction
should be used.
CMP= (Compare Equal To)
CMP<> (Compare Unequal To)
CMP< (Compare Less Than)
CMP> (Compare Greater Than)
CMP<= (Compare Less Than or Equal To)
CMP>= (Compare Greater Than or Equal To)
Data type W or I:
S1 = S2
→
D1 on
Data type D, L, or F:
S1·S1+1 = S2·S2+1
→
D1 on
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
compared. When S1 data is equal to S2 data, destination device D1 is turned
on. When the condition is not met, D1 is turned off.
REP
**
S1(R)
*****
D1(R)
*****
CMP=(*)
AND/OR
S2(R)
*****
Data type W or I:
S1 S2
→
D1 on
Data type D, L, or F:
S1·S1+1 S2·S2+1
→
D1 on
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
compared. When S1 data is not equal to S2 data, destination device D1 is
turned on. When the condition is not met, D1 is turned off.
REP
**
S1(R)
*****
D1(R)
*****
CMP<>(*)
AND/OR
S2(R)
*****
≠
≠
Data type W or I:
S1 < S2
→
D1 on
Data type D, L, or F:
S1·S1+1 < S2·S2+1
→
D1 on
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
compared. When S1 data is less than S2 data, destination device D1 is turned
on. When the condition is not met, D1 is turned off.
REP
**
S1(R)
*****
D1(R)
*****
CMP<(*)
AND/OR
S2(R)
*****
Data type W or I:
S1 > S2
→
D1 on
Data type D, L, or F:
S1·S1+1 > S2·S2+1
→
D1 on
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
compared. When S1 data is greater than S2 data, destination device D1 is
turned on. When the condition is not met, D1 is turned off.
REP
**
S1(R)
*****
D1(R)
*****
CMP>(*)
AND/OR
S2(R)
*****
Data type W or I:
S1 S2
→
D1 on
Data type D, L, or F:
S1·S1+1 S2·S2+1
→
D1 on
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
compared. When S1 data is less than or equal to S2 data, destination device
D1 is turned on. When the condition is not met, D1 is turned off.
REP
**
S1(R)
*****
D1(R)
*****
CMP<=(*)
AND/OR
S2(R)
*****
≤
≤
Data type W or I:
S1
≥
S2
→
D1 on
Data type D, L, or F:
S1·S1+1
≥
S2·S2+1
→
D1 on
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
compared. When S1 data is greater than or equal to S2 data, destination
device D1 is turned on. When the condition is not met, D1 is turned off.
REP
**
S1(R)
*****
D1(R)
*****
CMP>=(*)
AND/OR
S2(R)
*****
Summary of Contents for MICROSmart FC6A Series
Page 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Page 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...