Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controlers Applied Instructions 5
5-17
5.2.1 CMP (FNC 10)
Operation:
The data of S
1
is compared to the data of S
2
. The
result is indicated b
y
3 bit devices specified from
the head address entered as D. The bit devices
indicate:
S
2
is less than S
1
- bit device D is ON
S
2
is equal to S
1
- bit device D
+1
is ON
S
2
is
g
reater than S
1
- bit device D
+2
is ON
5.2.2 ZCP (FNC 11)
Operation:
The operation is the same as the CMP instruction
except a sin
g
le data value (S
3
) is compared a
g
ainst
a data ran
g
e (S
1
-S
2
).
S
3
is less than S
1
and S
2
- bit device D is ON
S
3
is equal to or between S
1
and S
2
- bit device D
+1
is ON
S
3
is
g
reater than both S
1
and S
2
- 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
g
iven.
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 a
g
ainst a
data ran
g
e -
results of <, = and
> are
g
iven.
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
X0
C 20 M 0
[ S2 ] [ D ]
[ S1 ]
K 100CMP
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 al
g
ebraic comparisons are used, i.e. -10 is smaller than +2 etc.
X0
K 120 M 3
[ S2 ] [ D ]
[ S1 ]
K 100ZCP
M3
M4
M5
C 30
[ S3 ]
C30<100,K120,M3=ON
K100 C30 K120,M4=ON
C30>K100,K120,M5=ON