Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
8 Applied Instructions (Move and Compare)
8.1 CMP / Compare
135
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied Instructions
(Program Flow)
8
Applied Instructions
(Move and
Compare)
9
Applied Instructions
(Arithmetic and
Logical Operation)
10
Applied Instructions
(Rotation and
Shift Operation)
Cautions
1) Some restrictions to applicable devices
S1:The FX
3U and FX3UC PLCs only are applicable. Not indexed (V,Z).
S2:The FX
3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
S3:The FX
3U and FX3UC PLCs only are applicable.
2) Instructions of pulse operation type are not provided in the FX
0, FX0S or FX0N PLC.
To execute pulse operation, make the instruction execution condition pulse type.
3) From the device specified as , three devices are occupied.
Be sure not to use those devices in another control.
Program examples
1. When comparing present value of a counter
If it is necessary to clear the comparison result when the instruction is not executed, add the following
contents under the above program.
1) RST
2) ZRST
X000
Turns ON in the case of
K100 > C 20 current value.
Turns ON in the case of
K100 = C 20 current value.
Turns ON in the case of
K100 < C 20 current value.
CMP
EN
s1
s2
ENO
d
M0
K100
CN20
[Structured ladder/FBD]
X000
CN20
M0
M1
M2
99
100
101
Latched
in the ON
status.
M0 Y000
M1 Y001
M2 Y002
CMP(X000, K100, CN20, M0);
Y000:=X000 AND M0;
Y001:=X000 AND M1;
Y002:=X000 AND M2;
Latched
in the ON
status.
Latched
in the ON
status.
RST
EN ENO
d
M0
RST
EN ENO
d
M1
RST
EN ENO
d
M2
X000
[Structured ladder/FBD] [ ST ]
RST(NOT X000, M0);
RST(NOT X000, M1);
RST(NOT X000, M2);
X000
M0
M2
M0 to M2 are reset.
ZRST
EN ENO
d1
d2
[Structured ladder/FBD] [ ST ]
ZRST(NOT X000, M0, M2);