3. Instructions
Reading the Results of Range Comparison
(C = 0002 hex)
If C is 0002 hex, PRV(881) reads the results of
range comparison and stores it in D as shown in
the following diagram.
Results for Eight Ranges
Results for 1 to 32 Ranges (CJ2M Only)
Reading Pulse Output or High-speed Counter Frequency (C = 00
If C is 00@3 hex, PRV(881) reads the frequency being output from pulse output 0 to 3 or the frequency
being input to high-speed counter 0 and stores it in D and D+1.
0000 or 0001 hex (Reading the frequency of pulse output 0 to 3)
0000 0000 to 0001 86A0 hex (0 to 100,000)
0010 hex (Reading the frequency of high-speed counter 0)
Counter input method: Any input method other than 4 differential phase mode:
Result = 0000 0000 to 0001 86A0 hex (0 to 100,000)
Note If a frequency higher than 100 kHz has been input, the output will remain at the maximum value of 0001
86A0 hex.
Counter input method: 4 differential phase mode:
Result = 0000 0000 to 0003 0D40 hex (0 to 200,000)
Note If a frequency higher than 200 kHz has been input, the output will remain at the maximum value of 200,000
decimal.
Pulse Frequency Calculation Methods
• Pulse Output:
The output frequency can be read by executing the PRV(881) instruction.
• High-speed Counter:
When the CPU Unit is a CJ1M CPU Unit with unit version 3.0 or later or a CJ2M CPU Unit, there are
two ways to calculate the frequency of pulses input to high-speed counter 0.
• Standard Calculation Method (Earlier Method): The count is calculated by counting each pulse
regardless of the frequency. At high frequencies, the rising or falling edges of some pulses will be
corrupted, resulting in errors (roughly 1% error max. at 100 kHz).
740
15
0
D 0 0 0 0 0 0 0 0
15
D
Comparison Result 16
OFF: Not in range ON: In range
15
D+1
Comparison Result 32
OFF: Not in range ON: In range
Note: The comparison result will be OFF for any of the 32 counter input ranges
that are not specified.
@
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Comparison Result 1
OFF: Not in range ON: In range
Comparison Result 2
OFF: Not in range ON: In range
Comparison Result 3
OFF: Not in range ON: In range
Comparison Result 4
OFF: Not in range ON: In range
Comparison Result 5
OFF: Not in range ON: In range
Comparison Result 6
OFF: Not in range ON: In range
Comparison Result 7
OFF: Not in range ON: In range
Comparison Result 8
OFF: Not in range ON: In range
0
Comparison Result 1
OFF: Not in range ON: In range
0
Comparison Result 17
OFF: Not in range ON: In range
3 hex)
Need help?
Do you have a question about the CJ - INSTRUCTIONS and is the answer not in the manual?