Double Signed Binary Compare - Cpsl - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Comparison Instructions
Precautions
Flags
Example
TR
0
00500
25505
25506
25507
5-19-7 DOUBLE SIGNED BINARY COMPARE – CPSL(––)
Placing other instructions between CPS(––) and the operation which
accesses the EQ, LE, and GR flags may change the status of these flags. Be
sure to access them before the desired status is changed.
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
EQ:
ON if Cp1 equals Cp2.
LE:
ON if Cp1 is less than Cp2.
GR:
ON if Cp1 is greater than Cp2.
Comparison result
Cp1 < Cp2
Cp1 = Cp2
Cp1 > Cp2
In the following example, the content of 102 is greater than that of DM 0020,
so 10000 is turned ON and the other bits, 10001 and 10002, are turned OFF.
CPS(−−)
102
DM 0020
000
10000
Greater Than
10001
Equal
10002
Less Than
Cp1: 102
6
F
A
4
(28,580 decimal)
Ladder Symbols
CPSL(−−)
Cp1
Cp2
000
Flag status
GR (SR 25505)
EQ (SR 25506)
0
0
0
1
1
0
Address Instruction
00000
LD
00001
OUT
00002
CPS(−−)
00003
AND
00004
OUT
00005
LD
00006
AND
00007
OUT
00008
LD
00009
AND
00010
OUT
Cp2: DM 0020
>
A
E
3
5
(−20,939 decimal)
Operand Data Areas
Cp1: First compare word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Cp2: Second compare word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Not used. Set to 000.
Section 5-19
LE (SR 25507)
1
0
0
Operands
00500
TR
0
102
DM
0020
000
25505
10000
TR
0
25506
10001
TR
0
25507
10002
000
287

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF