3. Instructions
Name
Equal Flag
Not Equal Flag
Less Than Flag
Less Than or Equal Flag
Negative Flag
Note In CS1D CPU Units for Duplex Systems, CS1 CPU Units, and CJ1 CPU Units, these are turned OFF.
In CJ2, CS1-H, CJ1-H, CJ1M, and CS1D CPU Units, these Flags are left unchanged.
Function
i
The input comparison instruction compares S1
and S2 as signed or unsigned values and creates
an ON execution condition when the comparison
condition is true.
The input comparison instructions are treated just
like the LD, AND, and OR instructions to control
the execution of subsequent instructions.
Input type
LD
The instruction can be connected directly to the
left bus bar.
AND
The instruction cannot be connected directly to the
left bus bar.
OR
The instruction can be connected directly to the
left bus bar.
Options
The input comparison instructions can compare signed or unsigned data and they can compare one-
word or double values. If no options are specified, the comparison will be for one-word unsigned data.
With the three input types and two options, there are 72 different input comparison instructions.
Symbol
=
(Equal)
< > (Not equal)
<
(Less than)
<= (Less than or equal)
>
(Greater than)
>= (Greater than or equal)
Unsigned input comparison instructions (i.e., instructions without the S option) can handle unsigned
binary or BCD data. Signed input comparison instructions (i.e., instructions with the S option) handle
signed binary data.
250
Label
=
• ON if S
= S
with one-word data.
1
2
• ON if S
+1, S
= S
1
1
• OFF in all other cases.
< >
• ON if S
S
with one-word data.
1
2
• ON if S
+1, S
1
1
• OFF in all other cases.
<
• ON if S
< S
with one-word data.
1
2
• ON if S
+1, S
< S
1
1
• OFF in all other cases.
< =
• ON if S
S
with one-word data.
1
2
• ON if S
+1, S
1
1
• OFF in all other cases.
N
OFF or unchanged (See note.)
Operation
Option (data format)
None: Unsigned data
S: Signed data
Operation
+1, S
with double-length data.
2
2
S
+1, S
with double-length data.
2
2
+1, S
with double-length data.
2
2
S
+1, S
with double-length data.
2
2
LD connection
<
S1
S2
AND connection
OR connection
<
S1
S2
Option (data length)
None: One-word data
L: Double-length data
CS/CJ/NSJ Series Instructions Reference Manual (W474)
ON execution condition when
comparison result is true.
ON execution condition when
comparison result is true.
<
S1
S2
ON execution condition when
comparison result is true.
Need help?
Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?