14: R
EFRESH
I
NSTRUCTIONS
14-4 FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
FRQRF (Frequency Measurement Refresh)
Example: FRQRF
Periodically update the current value of the frequency measurement value (D8210, D8211) using the FRQRF instruction in an
interrupt program.
When the frequency measurement value becomes 5,000 or greater, turn on the error signal (Q1).
When the input is on, the frequency measurement values (select from group 1 to group 6) allocated to special data
registers are updated to the latest values. (The group number of the selected high-speed counter is displayed under
the advanced instruction symbol.)
Before the measured results are reflected in special data registers, it takes a maximum of approximately 250 ms + the
scan time, but by using the FRQRF instruction, control processing using the latest current values of the frequency
measurements can be performed in any location in the user program.
For the frequency measurement function, see Chapter 5 "Frequency Measurement" in the "FC6A Series MICROSmart
User’s Manual".
Store 0 in D8036 and specify LABEL 0 as the interrupt program to execute
when the timer interrupt occurs.
M8120
END
Main Program
M8125
REPS1 –
0
D1 –
D8036
MOV(W)
M8125
M8125
IOREF S1
Q1
LRET
LABEL
0
FRQRF
1
REPS1 –
D8210
D1 –
Q1
CMP>(D) S2 –
5000
The interrupt program is separated from the main program by the END
instruction.
Interrupt program starts.
Update the current value (D8210, D8211) of the frequency measurement
value.
The status of output Q1 is reflected in the external output.
Interrupt program ends.
When the frequency measurement value becomes 5,000 or greater, turn on
Q1 as the error signal.