7-19
Section
Comparison Instructions
437
Flags
ER:
Indirectly addressed DM word is non-existent. (Content of
*
DM word is
not BCD, or the 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 DM 0001, DM 0000, then
20000 is turned ON; if the two contents are equal, 20001 is turned ON; if content
of HR 10, HR 09 is less than that of DM 0001, DM 0000, then 20002 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, 20000, 20001, and
20002 are changed only when CMPL(60) is executed.
CMPL(60)
DM 0000
HR 09
00000
25505
20000
25507
20002
TR
0
25506
20001
Greater Than
Equal
Less Than
---
Address
Instruction
Operands
00000
LD
00000
00001
OUT
TR
0
00002
CMPL(60)
HR
09
DM
0000
00003
AND
25505
00004
OUT
20000
00005
LD
TR
0
00006
AND
25506
00007
OUT
20001
00008
LD
TR
0
00009
AND
25507
00010
OUT
20002
7-19-5
AREA RANGE COMPARE – ZCP(––)
CD
: Compare data
IR, SR, AR, DM, HR, TC, LR, #
LL
: Lower limit of range
IR, SR, AR, DM, HR, TC, LR, #
Ladder Symbol
Operand Data Areas
UL
: Upper limit of range
IR, SR, AR, DM, HR, TC, LR, #
ZCP(––)
CD
LL
UL
Limitations
This instruction is available in the
CPM2A/CPM2C/SRM1(-V2) only
.
LL must be less than or equal to UL.
When the execution condition is OFF, ZCP(––) is not executed. When the
execution condition is ON, ZCP(––) compares CD to the range defined by lower
limit LL and upper limit UL and outputs the result to the GR, EQ, and LE flags in
the SR area. The resulting flag status is shown in the following table.
Comparison result
Flag status
p
GR (SR 25505)
EQ (SR 25506)
LE (SR 25507)
CD < LL
0
0
1
LL
≤
CD
≤
UL
0
1
0
UL < CD
1
0
0
Example:
Saving CMPL(60) Results
Description
Содержание SRM1 - PROGRAMING 02-2001
Страница 1: ...Programmable Controllers Cat No W353 E1 06 SYSMAC CPM1 CPM1A CPM2A CPM2C SRM1 V2 PROGRAMMING MANUAL ...
Страница 2: ...CPM1 CPM1A CPM2A CPM2C SRM1 V2 Programmable Controllers Programming Manual Revised February 2008 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 9: ...x ...
Страница 15: ...xvi ...