Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
8 Applied Instructions (Move and Compare)
8.3 MOV / Move
142
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Program examples
1. When reading the current value of a timer and counter
2. When indirectly specifying the set value of a timer or counter
As the set value of the timer T20, two values can be specified by turning ON or OFF the switch X002.
For specifying more than three set values, more than one switch is required.
3. When transferring a bit device
The program written by basic instructions shown below can be expressed using MOV instruction.
4. When transferring 32-bit data
Be sure to use DMOV instruction for transferring an applied instruction (such as MUL) whose operation result
is output in 32 bits, and for transferring a 32-bit numeric value or transferring the current value of a high speed
counter (C235 to C255) which is a 32-bit device.
(Current value of T0) (D20)
The operation is the same as a counter.
X001
MOV
EN
s
ENO
d
TN0 D20
[Structured ladder/FBD] [ ST ]
MOV(X001,TN0,D20);
(K100) (D 10)
D 10=K100(10-second timer)
D 10=K50(5-second timer)
When X002 is ON,
When X002 is OFF,
(K50)
(D 10)
D10
D10
X002
X002
MOV
EN
s
ENO
d
K100
MOV
EN
s
ENO
d
K50
OUT_T
EN ENO
TC20
M0
TCoil
TValue
D10
[Structured ladder/FBD]
[ ST ]
MOV(X002, K100, D10);
MOV(NOT X002, K50, D10);
OUT_T(M0, TC20, D10);
X000
X001
X002
X003
Y000
Y001
Y002
Y003
MOV(M8000, K1X000, K1Y000);
[Structured ladder/FBD]
[ ST ]
RUN
monitor
M8000
MOV
EN
s
ENO
d
K1X000
K1Y000
(D 1, D 0) (D 11, D 10)
(Current value of C235)
(D 21, D 20)
X000
DMOV
EN
s
ENO
d
X001
DMOV
EN
s
ENO
d
[Structured ladder/FBD]
[ ST ]
DMOV(X000, D0, D10);
DMOV(X001, CN235, D20);
D0 D10
CN235
D20