Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-17
5.2.1
CMP (FNC 10)
Operation:
The data of S
is compared to the data of S
2
. The
result is indicated by 3 bit devices specified from
the head address entered as D. The bit devices
indicate:
S
is less than S
- bit device D is ON 
S
is equal to S
- bit device D
+1 
is ON
S
is greater than S
- bit device D
+2 
is ON
5.2.2
ZCP (FNC 11)
Operation:
The operation is the same as the CMP instruction
except a single data value (S
3
) is compared against
a data range (S
1
-S
2
). 
S
is less than S
1
and S
2
- bit device D is ON
S
is equal to or between S
and S
- bit device D
+1
is ON
S
is greater than both S
and S
- bit device D
+2 
is
ON
Mnemonic
Function 
Operands
Program steps
S
1
S
2
D
CMP
FNC 10
(Compare)
Compares two
data values -
results of <, = and
> are given.
K, H,
KnX, KnY, KnM, KnS,
T, C, D, V, Z
Y, M, S
Note:
3 consecutive
devices are
used.
CMP, CMPP:
7 steps
DCMP,
DCMPP:
13 steps
Mnemonic
Function 
Operands
Program steps
S
1
S
2
S
3
D
ZCP
FNC 11
(Zone
compare)
Compares a data
value against a
data range -
results of <, = and
> are given.
K, H,
KnX, KnY, KnM, KnS,
T, C, D, V, Z
Note: 
S
1
 should be less than S
2
Y, M, S
Note:
3 consecutive
devices are
used.
ZCP,Z CPP:
9 steps
DZCP,
DZCPP:
17 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X0
C 20
M 0
[ S2 ] [ D ]
[ S1 ]
K 100
CMP
M0
M1
M2
C20>K100,M0=ON
C20=K100,M1=ON
C20>K100,M2=ON
Note: The destination (D) device statuses will be kept even if the CMP instruction is
deactivated. Full algebraic comparisons are used, i.e. -10 is smaller than +2 etc.
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X0
K 120
M 3
[ S2 ]
[ D  ]
[ S1 ]
K 100
ZCP
M3
M4
M5
C 30
[ S3 ]
C30<100,K120,M3=ON
K100 C30 K120,M4=ON
C30>K100,K120,M5=ON