Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 764

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

Pulse Frequency Calculation Methods
When the CPU Unit is a CJ1M CPU Unit with version number 3.0 or later, there are two ways to
calculate the frequency of pulses output from pulse output 0 or 1 or 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).
• High-frequency Calculation Method: In this case, the counting method is switched at high and low
frequencies.
At high frequencies (above 1 kHz), 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
At frequencies below 1 kHz, the Standard Calculation Method is used, regardless of the sampling time
setting.
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 for high frequency), 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.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
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
#0003
Read input frequency
D200
3. Instructions
3
727

Advertisement

Table of Contents
loading

Table of Contents