Comparison Instructions; Compare - Cmp(20) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Comparison Instructions

Description
Example
Flags

5-19 Comparison Instructions

5-19-1 COMPARE – CMP(20)
Limitations
280
When the execution condition is OFF, XFRB(––) is not executed. When the
execution condition is ON, XFRB(––) copies the specified source bits to the
specified destination bits. The two rightmost digits of C specify the starting
bits in S and D and the leftmost two digits indicate the number of bits that will
be copied.
Note Up to 255 (FF) bits can be copied at one time.
In the following example, XFRB(––) is used to transfer 5 bits from IR 020 and
IR 021 to LR 00 and LR 01. The starting bit in IR 020 is D (13), and the start-
ing bit in LR 00 is E (14), so IR 02013 to IR 02101 are copied to LR 0014 to
LR 0102.
00001
Bit
S+1: 021
15
0 1 0 1 0 1 0 0 0 0 0
1 1 1 0 0 0 0
Bit
D+1: LR 01
15
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 EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
Ladder Symbols
CMP(20)
Cp1
Cp2
When comparing a value to the PV of a timer or counter, the value must be in
BCD.
C
MSB
LSB
First bit of S (0 to F)
First bit of D (0 to F)
Number of bits (00 to FF)
Address Instruction
XFRB(−−)
00000
#05ED
00001
020
LR 00
Bit
00
0 0 0 1 0
1
0 0 1 1
1
1 0 1
Bit
00
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Section 5-19
Operands
LD
XFRB(−−)
#
LR
Bit
S: 020
15
1 1 1
1 0 1 0 0 0 0 0
1 1
0 0 0 1 0
0 1 0 1 0
Bit
D: LR 00
15
Operand Data Areas
Cp1: First compare word
Cp2: Second compare word
00001
05ED
020
00
Bit
00
1 0 1
0 0
0 0 0 1
Bit
00

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents