Omron C200H Operation Manual page 158

Hide thumbs Also See for C200H:
Table of Contents

Advertisement

Data Comparison
Limitations
Description
Precautions
Flags
Example:
Saving CMPL(60) Results
TR
0
00000
25505
25506
25507
Address
00000
00001
00002
00003
00004
Can be performed with the CPU11-E only.
When the execution condition is OFF, CMPL(60) is not executed. When the
execution condition is ON, CMPL(60) joins the 4-digit hexadecimal content of
Cp1+1 with that of Cp1, and that of Cp2+1 with that of Cp2 to create two
8-digit hexadecimal numbers, Cp+1,Cp1 and Cp2+1,Cp2. The two 8-digit
numbers are then compared and the result is output to the GR, EQ, and LE
flags in the SR area.
Placing other instructions between CMPL(60) and the operation which ac-
cesses the EQ, LE, and GR flags may change the status of these flags. Be
sure to access them before the desired status is changed.
Indirectly addressed DM word is non-existent. (Content of *DM word
ER:
is not BCD, or the DM area boundary has been exceeded.)
GR:
ON if Cp1+1,Cp1 is greater than Cp2+1,Cp2.
EQ:
ON if Cp1+1,Cp1 equals Cp2+1,Cp2.
LE:
ON if Cp1+1,Cp1 is less than Cp2+1,Cp2.
The following example shows how to save the comparison result immedi-
ately. If the content of HR 10, HR 09 is greater than that of 011, 010, then
00200 is turned ON; if the two contents are equal, 00201 is turned ON; if
content of HR 10, HR 09 is less than that of 011, 010, then 00202 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, 00200,
00201, and 00202 are changed only when CMPL(60) is executed.
Instruction
Operands
LD
00000
OUT
TR
CMPL(60)
HR
LD
TR
AND
25505
CMPL(60)
HR 09
010
---
00200
00201
00202
Address
Instruction
00005
OUT
0
00006
LD
00007
AND
09
00008
OUT
010
00009
LD
00010
AND
0
00011
OUT
Section 5-15
Greater Than
Equal
Less Than
Operands
00200
TR
0
25506
00201
TR
0
25507
00202
145

Advertisement

Table of Contents
loading

Table of Contents