253
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Comparison Instructions
3
=, <>, <, <=, >, >=
Comparison Instructions
=, <>, <, <=, >, >=
Note Input comparison instructions are available to compare signed or unsigned data of one-word or double length data.
Refer to 3-15-24 Single-precision Floating-point Comparison Instructions for details on single-precision floating-point
input comparison instructions and 3-16-21 Double-precision Floating-point Input Comparison Instructions for details on
double-precision floating-point input comparison instructions.
Applicable Program Areas
Operands
z Operand Specifications
Flags
Instruction Mnemonic Variations
Function
code
Function
Input Comparison Instructions
=, <>, <, <=, >,
>=
--- 300 to 328
Input comparison instructions compare two values
(constants and/or the contents of specified words)
and create an ON execution condition when the
comparison condition is true.
Symbol
=, <>, <, <=, >, >=
LD connection AND connection OR connection
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK OK OK OK
Operand Description
Data type Size
Unsigned
Unsigned
double length
Signed
Signed
double length
One-word Double length
S1 Comparison data 1 UINT UDINT INT DINT 1 2
S2 Comparison data 2 UINT UDINT INT DINT 1 2
Area
Word addresses
Indirect
DM/EM
addresses
Con-
stants
Registers
TK CF
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
One-word
Data
S1
OK OK OK OK OK OK OK OK OK OK OK OK --- OK --- --- --- ---
S2
Double-
length Data
S1
OK OK OK OK OK OK OK OK OK OK OK --- OK OK --- --- --- ---
S2
Name Label Operation
Error Flag ER OFF or unchanged (See note.)
Greater Than Flag > • ON if S
1
> S
2
with one-word data.
•ON if S
1
+1, S
1
> S
2
+1, S
2
with double-length data.
• OFF in all other cases.
Greater Than or Equal Flag > = • ON if S
1
≥ S
2
with one-word data.
•ON if S
1
+1, S
1
≥ S
2
+1, S
2
with double-length data.
• OFF in all other cases.
S1
S2
S1: Comparison data 1
S2: Comparison data 2
Mnemonic
S1
S2
S1: Comparison data 1
S2: Comparison data 2
Mnemonic
S1
S2
S1: Comparison data
S2: Comparison data
Mnemonic