Data Comparison - Omron SYSMAC C200HS Operation Manual

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Data Comparison

Example
Flags
5-17 Data Comparison
5-17-1 MULTI-WORD COMPARE – MCMP(19)
Limitations
Description
Flags
In the following example, XFRB(62) is used to transfer 5 bits from IR 020 to
LR 21 when IR 00001 is ON. The starting bit in IR 020 is 0, and the starting bit in
LR 21 is 4, so IR 02000 to IR 02004 are copied to LR 2104 to LR 2108.
00001
Bit
15
S (IR 020)
Bit
15
D (LR 21)
ER:
The specified source bits are not all in the same data area.
The specified destination bits are not all in the same data area.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
not BCD, or the DM area boundary has been exceeded.)
Ladder Symbols
MCMP(19)
@MCMP(19)
TB1
TB2
R
TB1 and TB1+15 must be in the same data area, as must TB2 and TB2+15.
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.
ER:
One of the tables (i.e., TB1 through TB1+15, or TB2 through TB2+15)
exceeds the data area.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
not BCD, or the DM area boundary has been exceeded.)
Address
XFRB(62)
00000
#0540
00001
IR 020
LR 21
0 1 0 1 0 1 0 0 0 0 0 1
0 1 0 0 0 1 0
1 0 1 1 1
TB1
TB2
R
Section 5-17
Instruction
Operands
LD
XFRB(62)
#
LR
Bit
00
0 1 1 1
Bit
00
0 0 0 1
Operand Data Areas
TB1: First word of table 1
IR, SR, AR, DM, HR, TC, LR
TB2: First word of table 2
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, TC, LR
00001
0540
020
21
169

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents