Omron C200HX Computer Hardware User Manual


 
197
The following example shows how to save the comparison result immediately. 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.
CMPL(60)
010
HR 09
00000
25505
00200
25507
00202
TR
0
25506
00201
Greater Than
Equal
Less Than
---
Address Instruction Operands Address Instruction Operands
00000 LD 00000
00001 OUT TR 0
00002 CMPL(60)
HR 09
010
00003 AND 25505
00004 OUT 00200
00005 LD TR 0
00006 AND 25506
00007 OUT 00201
00008 LD TR 0
00009 AND 25507
00010 OUT 00202
5-17-4 BLOCK COMPARE BCMP(68)
CD: Compare data
IR, SR, AR, DM, HR, TC, LR, #
CB: First comparison block word
IR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R: Result word
IR, SR, AR, DM, HR, TC, LR
BCMP(68)
CD
CB
R
@BCMP(68)
CD
CB
R
Limitations Each lower limit word in the comparison block must be less than or equal to the
upper limit.
Example:
Saving CMPL(60) Results
Data Comparison Section 5-17