beautypg.com

Campbell Scientific CR23X Micrologger User Manual

Page 138

background image

SECTION 9. INPUT/OUTPUT INSTRUCTIONS

9-4

TABLE 9-3. Execution and Counter Reset Intervals and Maximum Input Frequencies

User
Programmed

Counter

Counter

Maximum

Execution

Reset

Reset

Input

Interval (s)

Interval (s)

Frequency (Hz)

Frequency (kHz)

0.01

0.01

100

25.5

0.02

0.02

50

12.75

0.03

0.01

100

25.5

0.04

0.02

50

12.75

0.05

0.05

20

5.10

0.10

0.10

10

2.55

0.15

0.05

20

5.10

0.80

0.10

10

2.55

1.0

0.10

10

2.55

Control Port Details: Coprocessor and
Accumulators

Counts on Control Ports C5..C8 are measured
by a coprocessor. The coprocessor transfers
counts into 16 bit accumulators. The
accumulators accumulate up to 65,535 counts.
Counts accumulate in the accumulators until the
program table containing Pulse Count
Instruction 3 is executed. The execution
interval of the table must be short enough
that the accumulator does not overflow.
At
the beginning of the execution, totals in the
accumulators are transferred to a temporary
RAM buffer. The accumulator is then zeroed.
When the execution reaches Pulse Count
Instruction 3, the value in the RAM buffer is
multiplied by the multiplier, added to the offset,
then placed into the designated input location.

CAUTION: The RAM buffer does not
accumulate counts; it is zeroed each time the
table is executed regardless of whether or not
the pulse instruction is executed. If all counts
are necessary, it is imperative that the Pulse
Count Instruction be executed (not branched
around) every time the table is executed.

When the execution interval is < 4.0 s, ports
C5..C8 measure the actual time between edges
of the pulse with a 0.5

µ

s resolution. The

resulting frequency resolution is
(0.5)*(Frequency). Therefore, for execution
intervals < 4.0 second, ports C5..C8 yield more
accurate frequency measurements, especially
for low-frequency signals, than do pulse
counters P1..P4.

For execution intervals

4.0 s, ports C5..C8

simply accumulate pulses similar to pulse
counter channels P1..P4.

Using ports C5..C8 to count pulses increases
the quiescent current of the CR23X by 8 mA.
Maximum input frequency on ports C5..C8 is
2.5 kHz.

Table Overruns / Executions

Table overruns occur when a program is too
long for its programmed execution interval, the
CR23X clock is reset, or a table of higher
priority is still running. When a table overrun
occurs, the value in the accumulator is the
result of a longer than normal interval. This
value can either be used or it can be discarded.
If pulse counts are being totalized, a missing
count could be significant and the value from
the erroneously long interval should NOT be
discarded. If the pulse count is being
processed in a way in which the resultant value
is dependent upon the sampling interval (e.g.,
speed, RPM), the value from the excessive
interval should be discarded. If the value is
discarded the value in the RAM buffer from the
previous measurement will be used.

Frequency Result

An option to output the count as a frequency
(Hz or Hertz) is also available. At Execution
Intervals less than four seconds, control ports
C5..C8 measure the time element in the
frequency calculation, whereas pulse channels
P1..P4 simply use the programmed Execution
Interval. Consequently, at Execution Intervals