7-17
7 High-speed Counters
CJ2M CPU Unit Pulse I/O Module User’s Manual
7-2 High-speed Counter Inputs
7
7-2-5 Frequency Measurement
The PV that is stored in the following words can be read using the MOVL(498) instruction or other
instructions.
z Reading the High-speed Counter PV with a PRV(881) Instruction
LPV(893) reads the PV of the high-speed counter each time an interrupt input occurs and stores the
value in the Auxiliary Area.
It reads the PV immediately before the interrupt task is started. LPV(893) reads the PV more in real-
time than starting an interrupt task and using the PRV(881) instruction to read the PV.
Refer to Using Software Latches on page 6-8.
This function measures the frequency of the high-speed counter (input pulses.)
The input pulse frequency can be read by executing the PRV(881) 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.
Reading the PV Refreshed at the I/O Refresh Timing
Pulse I/O
Module No.
Read PV Auxiliary Area words
0 (on the right) High-speed counter 0 A271 (upper digits) and A270 (lower digits)
High-speed counter 1 A273 (upper digits) and A272 (lower digits)
1 (on the left) High-speed counter 2 A317 (upper digits) and A316 (lower digits)
High-speed counter 3 A319 (upper digits) and A318 (lower digits)
Reading the Value When a Ladder Program is Executed
Reading the PV When there Is an Interrupt Input
7-2-5 Frequency Measurement
Overview
@PRV
#0010
#0000
D100
15 0
D100
D101
P: Port specifier, Example: High-speed counter input 0
C: Control Data (to read PV)
D: First Destination Word
PV data lower bytes
PV data upper bytes
High-speed counter PV that was read
Execution condition