Compare - Cmp(20) - Omron C200H Operation Manual

Hide thumbs Also See for C200H:
Table of Contents

Advertisement

Data Comparison
Example
00000
TB1: IR 100
IR 100
IR 101
IR 102
IR 103
IR 104
IR 105
IR 106
IR 107
IR 108
IR 109
IR 110
IR 111
IR 112
IR 113
IR 114
IR 115
5-15-2
COMPARE – CMP(20)
Limitations
Description
Precautions
142
The following example shows the comparisons made and the results pro-
vided for MCMP(19). Here, the comparison is made during each cycle when
00000 is ON.
MCMP(19)
DM 0200
DM 0300
TB2: DM 0200
0100
DM 0200
0200
DM 0201
0210
DM 0202
ABCD
DM 0203
ABCD
DM 0204
ABCD
DM 0205
ABCD
DM 0206
0800
DM 0207
0900
DM 0208
1000
DM 0209
ABCD
DM 0210
ABCD
DM 0211
ABCD
DM 0212
1400
DM 0213
0210
DM 0214
1212
DM 0215
Ladder Symbols
CMP(20)
Cp1
Cp2
When comparing a value to the PV of a timer or counter, the value must be in
BCD.
When the execution condition is OFF, CMP(20) is not executed. When the
execution condition is ON, CMP(20) compares Cp1 and Cp2 and outputs the
result to the GR, EQ, and LE flags in the SR area.
Placing other instructions between CMP(20) 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.
Address Instruction
00000
LD
100
00001
MCMP(19)
R: DM 0300
0100
DM 030000
0200
DM 030001
0210
DM 030002
0400
DM 030003
0500
DM 030004
0600
DM 030005
0210
DM 030006
0800
DM 030007
0900
DM 030008
1000
DM 030009
0210
DM 030010
1200
DM 030011
1300
DM 030012
1400
DM 030013
0210
DM 030014
1600
DM 030015
Section 5-15
Operands
00000
100
DM
0200
DM
0300
0
0
0
1
1
1
1
0
0
0
1
1
1
0
0
1
Operand Data Areas
Cp1: First compare word
IR, SR, AR, DM, HR, TC, TR, #
Cp2: Second compare word
IR, SR, AR, DM, HR, TC, LR, #

Advertisement

Table of Contents
loading

Table of Contents