Omron SYSMAC CP Series Instruction & Reference Manual page 350

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Reading Pulse Output or High-speed Counter Frequency (C = 00@3 hex)
If C is 00@3 hex, PRV(881) reads the frequency being output from pulse output 0 or 1 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 or 1)
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 = 00000000 to 000186A0 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 000186A0
hex.
Counter input method: 4× differential phase mode:
Result = 00000000 to 00030D40 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
00030D40 hex.
Pulse Frequency Calculation Methods
The function counts the number of pulses within a fixed interval (the sampling time) and calculates the
frequency from that count. One of the following three sampling times can be selected by setting the
rightmost two digits of C.
Sampling time
10 ms
100 ms
1 s
Precautions
If the counter is reset when P is 0010 hex (high-speed counter 0) and C is 0013, 0023, or 0033 hex
(sampling method), the data read during the sampling time when the counter was reset will not be
dependable.
Sample program
When CIO 0.00 turns ON in the following
programming example, CTBL(882) registers
a range comparison table for high-speed
counter 0 and starts comparison. When CIO
0.01 turns ON, PRV(881) reads the range
comparison results at that time and stores
them in CIO 0100.
When CIO 1.00 turns ON in the following
programming example, PRV(881) reads the
frequency of the pulse being input to high-
speed counter 0 at that time and stores it as
a hexadecimal value in D200 and D201.
2-314
Value of C
0013 hex
Counts the number of pulses every 10 ms. The error is 10% max. at 1 kHz.
0023 hex
Counts the number of pulses every 100 ms. The error is 1% max. at 1 kHz.
0033 hex
Counts the number of pulses every 1 s. The error is 0.1% max. at 1 kHz.
Description
0.00
@CTBL
High-speed counter input 0
#0000
Range comparison table
#0001
registration and comparison start
D100
0.01
@PRV
High-speed counter input 0
#0010
Read range comparison results
#0002
100
1.00
PRV
High-speed counter input 0
#0010
#0013
Read input frequency
D200
CP1E CPU Unit Instructions Reference Manual(W483)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents