EasyManuals Logo
Home>Omron>Controller>CQM1H - PROGRAM

Omron CQM1H - PROGRAM User Manual

Omron CQM1H - PROGRAM
602 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #306 background imageLoading...
Page #306 background image
281
Comparison Instructions Section 5-19
Description 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.
Precautions 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.
Flags 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.
Example:
Saving CMP(20) Results
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.
Flag Address C1 < C2 C1 = C2 C1 > C2
GR 25505 OFF OFF ON
EQ 25506 OFF ON OFF
LE 25507 ON OFF OFF
CMP(20)
010
HR 09
00000
25505
10200
25507
10202
TR
0
25506
10201
Greater Than
Equal
Less Than
Address Instruction Operands Address Instruction Operands
00000 LD 00000
00001 OUT TR 0
00002 CMP(20)
HR 09
010
00003 AND 25505
00004 OUT 10200
00005 LD TR 0
00006 AND 25506
00007 OUT 10201
00008 LD TR 0
00009 AND 25507
00010 OUT 10202

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Omron CQM1H - PROGRAM Specifications

General IconGeneral
BrandOmron
ModelCQM1H - PROGRAM
CategoryController
LanguageEnglish

Related product manuals