11-13
11 High-speed Counters
CP2E CPU Unit Software User’s Manual(W614)
11-2 High-speed Counter Inputs
11
11-2-5 Frequency Measurement
This function measures the frequency of the high-speed counter (input pulses.)
The input pulse frequency can be read by executing the PRV instruction. The measured frequency is
output in 8-digit hexadecimal and expressed in Hz. The frequency measurement function can be used
with high-speed counter 0 only.
The frequency can be measured while a high-speed counter 0 comparison operation is in progress.
Frequency measurement can be performed at the same time as functions such as the high-speed
counter and pulse output without affecting the performance of those functions.
z Reading the High-speed Counter Frequency with a PRV Instruction
Precautions for Correct UsePrecautions for Correct Use
The frequency measurement function can be used with high-speed counter 0 only.
z Specifications
* If the frequency exceeds the maximum value, the maximum value will be stored.
11-2-5 Frequency Measurement
Overview
Item Specifications
Number of frequency mea-
surement inputs
1 input (high-speed counter 0 only)
Frequency measurement
range
High-speed counter 0:
Differential phase inputs: 0 to 50 kHz
All other input modes: 0 to 100 kHz
Measurement method Execution of the PRV instruction
Stored data Unit Hz
Output data
range*
Differential phase input: 0000 0000 to 0003 0D40 hex (0 to 200 kHz)
All other input modes: 0000 0000 to 0001 86A0 hex (0 to 100 kHz)
@PRV
#0010
#0013
D100
15 0
D100
D101
Present frequency
data upper bytes
Execution condition
C1: Port specifier (example for high-speed counter input 0 (fixed))
C2: Control data for reading frequency (10-ms sampling)
S: First destination word
Present frequency
data lower bytes
High-speed counter frequency
that was read