Mitsubishi Electronics FX3G User Manual

Page of 964
597
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
24 Others – FNC181 to FNC189
24.5 FNC189 – HCMOV / High-Speed Counter Move
21
FNC160
-F
NC1
69
R
eal
 T
ime C
lock
 
C
ontrol
22
FNC17
0-F
NC
179
E
xternal D
evice
23
FNC
180
Alternate 
Instructions
24
FN
C181-
FNC18
9
O
thers
25
FNC190
-F
NC1
99
Bl
oc
k D
ata
 
Op
er
ation
26
FNC20
0-F
NC209
C
har
ac
te
r S
trin
Con
tro
l
27
FNC2
10-
FNC21
9
Dat
Operati
on 3
28
FNC220
-F
NC2
49
Da
ta 
C
omp
ari
son
29
FNC25
0-F
N
C
269
D
ata T
abl
Operation
30
FNC2
70-
FNC276
Ex
-Dev
ice
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 applied 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
• 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.
• 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. The following points must be kept 
in mind when using the DHCMOV command.
- When the current value of a high-speed 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.
→ For the condition in which a hardware counter is handled as a software counter, refer to Subsection 4.8.9.
- When the number of high-speed software counter comparison instructions is reduced, the total frequency 
limitation is decreased.
→ For the limitation in software counters by the total frequency, refer to Subsection 4.8.10.
- 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-speed counter comparison instruction (HSCS, 
HSCR or HSZ).
- 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 (FNC 04) and FEND (FNC 06) instructions in the main program. They are necessary to execute an
input interrupt program.
→ For EI (FNC 04) and FEND (FNC 06) instructions, refer to Section 8.5 and Section 8.7.
2) When programming DHCMOV instruction in the 1st line in an input interrupt program, make sure to use the
pattern program shown below. Make sure to use the command contact M8394. Do not add, change, or delete this
pattern program when writing during RUN. Interrupt programs may not operate normally.
Current value update timing
Hardware counter
When OUT instruction for the counter is executed
Software counter
Every time a pulse is input
FNC 03
IRET
M8394
n
FNC189
DHCMOV
I
Pattern program for using the
DHCMOV instruction in an interrupt
program
Program to be processed as input
interrupt
S
D