Multi-Word Compare - Mcmp(19) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Comparison Instructions
Flags
Example:
Saving CMPL(60) Results
TR
0
00000
25505
25506
25507
5-19-5 MULTI-WORD COMPARE – MCMP(19)
Limitations
Description
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.)
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 immediately.
If the content of HR 10, HR 09 is greater than that of 011, 010, then 10000 is
turned ON; if the two contents are equal, 10001 is turned ON; if content of HR
10, HR 09 is less than that of 011, 010, then 10002 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, 10000, 10001, and
10002 are changed only when CMPL(60) is executed.
CMPL(60)
HR 09
010
---
10000
Greater Than
10001
Equal
10002
Less Than
Ladder Symbols
MCMP(19)
@MCMP(19)
TB1
TB2
R
TB1 and TB1+15 must be in the same data area.
TB2 and TB2+15 must be in the same data area.
DM 6144 to DM 6655 cannot be used for R.
When the execution condition is OFF, MCMP(19) is not executed. When the
execution condition is ON, MCMP(19) compares the content of TB1 to TB2,
TB1+1 to TB2+1, TB1+2 to TB2+2, ..., and TB1+15 to TB2+15. If the first pair
is equal, the first bit in R is turned OFF, etc., i.e., if the content of TB1 equals
the content of TB2, bit 00 is turned OFF, if the content of TB1+1 equals the
content of TB2+1, bit 01 is turned OFF, etc. The rest of the bits in R will be
turned ON.
Address Instruction
00000
LD
00001
OUT
00002
CMPL(60)
00003
AND
00004
OUT
00005
LD
00006
AND
00007
OUT
00008
LD
00009
AND
00010
OUT
TB1: First word of table 1
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
TB2: First word of table 2
TB1
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
TB2
R
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
Section 5-19
Operands
00000
TR
0
HR
09
010
25505
10000
TR
0
25506
10001
TR
0
25507
10002
Operand Data Areas
R: Result word
285

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF