Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
24 Applied Instructions (Others)
24.5 DHCMOV / High Speed Counter Move
597
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
2) After transfer, the current value of the high speed counter or ring counter is processed as shown in the
table below depending on the set value of "n".
*1. Ring counters (D8099 and D8398) cannot be specified in FX
3UC PLCs earlier than Ver. 2.20 (not
inclusive).
2. High speed counter current value update timing and the effect of DHCMOV instruction
1) High speed counter current value update timing
When a pulse is input to an input terminal for a high speed counter (C235 to C255), the high speed
counter executes up-counting or down-counting.
If the current value of a high speed counter is handled in an instruction such as the normal MOV
instruction, the current value is updated at the timing shown in the table below. As a result, it is affected
by the program scan time.
By using DHCMOV instruction, the current value can be updated and transferred when it is executed.
2) Effect of DHCMOV instruction
a) By using both input interrupt and DHCMOV instruction, the current value of a high speed counter can
be received at the rising edge or falling edge of an external input (at reception of input interrupt).
Refer to the Program example 2.
b) When DHCMOV instruction is used just before a comparison instruction (CMP, ZCP or comparison
contact instruction), the latest value of a high speed counter is used in comparison. Unlike the
comparison instruction for high speed counters (DHSCS, DHSCR or DHSZ), the following points must
be kept in mind when using the DHCMOV instruction.
- When the current value of a hardware counter is compared using CMP, ZCP or comparison contact
instruction (not using a designated high speed counter comparison instruction), a hardware counter
does not change into a software counter.
FX Structured Programming Manual [Device & Common]
- When the number of high speed software counter comparison instructions is reduced, the total
frequency limitation is decreased.
FX Structured Programming Manual [Device & Common]
- When it is necessary to execute comparison and change an output contact (Y) as soon as the
current value of a high speed counter changes, use a designated high seed counter comparison
instruction (DHSCS, DHSCR or DHSZ)
- DHCMOV instruction can be used as many times as necessary.
Cautions
When programming DHCMOV instruction in an input interrupt program, the following points should be
observed.
For assignment of pointers for input interrupt and inputs, refer to the table shown in 5) below.
1) Program EI and FEND instructions in the main program.
They are necessary to execute an input interrupt program.
For EI and FEND, refer to Sections 7.6 and 7.7.
2) When programming DHCMOV instruction in the first line in an input interrupt program, be sure to use the
pattern program shown below. Be sure to use the command contact M8394.
"n" set value Operation
K0(H0) Does not clear the current value (no processing).
K1(H1) Clears the current value to "0".
Current value update timing
Hardware counter When OUT instruction for the counter is executed
Software counter Every time a pulse is input
(Event : I )
M8394
Pattern program for using the DHCMOV
instruction in an interrupt program.
Program to be processed as input interrupt
DHCMOV
EN ENO
d
s
n
Specification to clear the current
value of high speed counter or ring
counter (transfer source) after transfer
Device of high speed counter or ring
counter handled as transfer source
Device
handled as
transfer
destination
[Interrupt program]