Omron CQM1H - PROGRAM Programming Manual page 306

Programmable controllers; inner boards
Table of Contents

Advertisement

Comparison Instructions
Description
Precautions
Flags
Example:
Saving CMP(20) Results
TR
0
00000
Address Instruction
00000
00001
00002
00003
00004
When the execution condition is OFF, CMP(20) is not executed. When the
execution condition is ON, CMP(20) compares Cp1 and Cp2 and outputs the
result to the GR, EQ, and LE flags in the SR area.
Placing other instructions between CMP(20) 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.
Flag
GR
25505
EQ
25506
LE
25507
The following example shows how to save the comparison result immediately.
If the content of HR 09 is greater than that of 010, 10200 is turned ON; if the
two contents are equal, 10201 is turned ON; if content of HR 09 is less than
that of 010, 10202 is turned ON. In some applications, only one of the three
OUTs would be necessary, making the use of TR 0 unnecessary. With this
type of programming, 10200, 10201, and 10202 are changed only when
CMP(20) is executed.
25505
25506
25507
Operands
LD
00000
OUT
TR
CMP(20)
HR
09
010
AND
25505
OUT
10200
Address
C1 < C2
OFF
OFF
ON
CMP(20)
HR 09
010
Address Instruction
00005
LD
0
00006
AND
00007
OUT
00008
LD
00009
AND
00010
OUT
Section 5-19
C1 = C2
OFF
ON
ON
OFF
OFF
OFF
10200
Greater Than
10201
Equal
10202
Less Than
Operands
TR
0
25506
10201
TR
0
25507
10202
C1 > C2
281

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?

Questions and answers

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF