Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 747

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

High-speed Counter/Pulse Output Instructions
Flags
Examples
714
The count is calculated by counting each pulse regardless of the frequen-
cy. At high frequencies, the rising or falling edges of some pulses will be
corrupted, resulting in errors (roughly 1% error max. at 100 kHz and the
maximum error at 1 MHz).
2. High-frequency Calculation Method
In this case, the counting method is switched at high and low frequencies.
• High-frequency counting
At high frequencies (above 1 kHz), the function counts the number of
pulses within a fixed interval (the sampling time) and calculates the fre-
quency 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
• Low-frequency counting
At frequencies below 1 kHz, the Standard Calculation Method is used,
regardless of the sampling time setting.
Name
Label
Error Flag
ER
Example 1
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 com-
parison. When CIO 0.01 turns ON, PRV(881) reads the range comparison
results at that time and stores them in CIO 100.00.
Value of C
0013 hex
Counts the number of pulses every 10 ms.
The error is 0.1% max. at 100 kHz.
The maximum error will occur at 1 kHz
(10%).
0023 hex
Counts the number of pulses every 100 ms.
The error is 0.01% max. at 100 kHz.
The maximum error will occur at 1 kHz
(1%).
0033 hex
Counts the number of pulses every 1 s. The
error is 0.001% max. at 100 kHz.
The maximum error will occur at 1 kHz
(0.1%).
Operation
ON if the specified range for P or C is exceeded.
ON if the combination of P and C is not allowed.
ON if reading range comparison results is specified even
though range comparison is not being executed.
ON if reading the output frequency is specified for any-
thing except for high-speed counter 0.
ON if specified for a port not set for a high-speed counter.
ON if executed for a port not set for an interrupt input in
counter mode.
Section 3-20
Description

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents