Omron SYSMAC CP Series Instruction & Reference Manual page 126

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Function
True if C1 ≤ C2
True if C1 > C2
True if C1 ≥ C2
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.
Hint
• Unlike instructions such as CMP(020) and CMPL(060), the result of an input comparison instruction
is reflected directly as an execution condition, so it is not necessary to access the result of the com-
parison through an Arithmetic Flag and the program is simpler and faster.
Precautions
• Input comparison instructions cannot be used as right-hand instructions, i.e., another instruction
must be used between them and the right bus bar.
Sample program
AND LESS THAN: AND<(310)
When CIO 0.00 is ON in the following example, the contents of D100 and D200 are compared in as
unsigned binary data. If the content of D100 is less than that of D200, CIO 100.00 is turned ON and
execution proceeds to the next line. If the content of D100 is not less than that of D200, the remainder
of the instruction line is skipped and execution moves to the next instruction line.
0.00
0.01
AND SIGNED LESS THAN: AND<S(312)
When CIO 0.01 is ON in the following example, the contents of D110 and D210 are compared as
signed binary data. If the content of D110 is less than that of D210, CIO 100.01 is turned ON and exe-
cution proceeds to the next line. If the content of D110 is not less than that of D210, the remainder of
the instruction line is skipped and execution moves to the next instruction line.
0.00
0.01
2-90
Mnemonic
LD/AND/OR <=
LESS THAN OR EQUAL
LD/AND/OR<=L
DOUBLE LESS THAN OR EQUAL
LD/AND/OR <=S
SIGNED LESS THAN OR EQUAL
LD/AND/OR <=SL
DOUBLE SIGNED LESS THAN OR EQUAL
LD/AND/OR >
GREATER THAN
LD/AND/OR >L
DOUBLE GREATER THAN
LD/AND/OR >S
SIGNED GREATER THAN
LD/AND/OR >SL
DOUBLE SIGNED GREATER THAN
LD/AND/OR >=
GREATER THAN OR EQUAL
LD/AND/OR >=L
DOUBLE GREATER THAN OR EQUAL
LD/AND/OR >=S
SIGNED GREATER THAN OR EQUAL
LD/AND/OR>=SL
DBL SIGNED GREATER THAN OR EQUAL
100.00
<
D100
D200
100.01
<S
D110
D210
<
D100
D200
<S
D110
D210
Name
i
S
: D100
Unsigned
1
LESS THAN
Comparison
Decimal: 34,580
100.00
S
: D110
1
Signed
LESS THAN
Comparison
Decimal: −30,956
100.01
CP1E CPU Unit Instructions Reference Manual(W483)
S
: D200
2
8714
3A1C
Decimal: 14,876
34,580 > 14,876
(Will not proceed to next line.)
S
: D210
2
8714
3A1C
Decimal: 14,876
−30,956 < 14,876
(Will proceed to next line.)
Code
315
316
317
318
320
321
322
323
325
326
327
328

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents