beautypg.com

Pulsecountreset, Pulsecount parameters – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 261

background image

Section 7. Measurement Instructions

7-37

Parameter
& Data Type

Enter

PULSECOUNT PARAMETERS

Dest

Variable or
Array

The Variable in which to store the results of the instruction. When Reps are used the results are stored in
an array with the variable name. An array must be dimensioned to have elements for all the Reps.

Reps

Constant

The number of repetitions for the measurement or instruction.

PSlot

Constant

The number of the slot that holds the 9070/9071E Counter Timer Module for the measurement.

Pconfig

A code specifying the type of pulse input to measure.

Constant

Code

Pulse Channels

Input Configuration

0

1 - 12

High Frequency

1

1 - 8

Low Level AC

1

9 - 12

Switch Closure

Poption
Constant

A code that determines if the raw result (multiplier = 1, offset = 0) is returned as counts or frequency.
The running average can be used to smooth out readings when a low frequency relative to the scan rate
causes large fluctuations in the measured frequency from scan to another.

Code Result

0

Counts

1

Frequency (Hz) counts/scan interval in seconds

>1

Running average of frequency. The number entered is the time period over
which the frequency is averaged in milliseconds.

Mult, Offset

Constant,
Variable,
Array, or
Expression

A multiplier and offset by which to scale the raw results of the measurement. See the measurement
description for the units of the raw result; a multiplier of one and an offset of 0 are necessary to output in
the raw units. For example, the TCDiff instruction measures a thermocouple and outputs temperature in
degrees C. A multiplier of 1.8 and an offset of 32 will convert the temperature to degrees F.

PulseCountReset

The PulseCountReset instruction is used to reset the pulse counters and the
running averages used in the pulse count instruction. It resets all counters in
all installed CR9070/CR9071E Counter and Digital I/O modules. The
CR9070's 16 bit counters can count up to decimal 65535. More counts than
65535 result in an over-range condition. The CR9071E's 32 bit counters can
count up to 4.29 billion before over-ranging. This should never occur within a
Scan because at the maximum input frequency of 1 MHz, it would take almost
72 minutes before it fills, while the CR9000X's maximum scan rate is 1
minute.

At the beginning of each scan, the CR9000X reads the counts accumulated
since the last scan and then resets the counter. If the scans stop, as in a
program with more that one Scan loop in the Main Program, or in a program
that calls an external subroutine, the counter continues to accumulate counts
until the Scan with the PulseCount instruction is reentered. This can lead to
erroneous high values when outputting frequency, as the output is:

CR9070: The pulse count difference from the previous scan divided

by the scan interval.

CR9071E The pulse count divided by the time between the last pulse

of the scan before exiting the Scan and the last pulse before
the ExitScan on NextScan of the Scan in the Subroutine.

The error can be greatly magnified when the time duration is over the 171
second limit of the pulse counter timer.