Section 7. Measurement Instructions
7-23
Parameter
& Data Type
Enter
PULSECOUNT INSTRUCTION
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
PulseCountReset
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 because at the maximum
input frequency of 1 MHz, it would take almost 72 minutes before it fills while
the CR9000's maximum scan rate is 1 minute. With each scan, the CR9000
reads the counts accumulated since the last scan and then resets the counter. If
the scans stop, as in burst operation or in a program with more that one Scan
loop, the counter continues to accumulate counts until another scan is initiated
or it over-ranges. If the running averaging is in use, the over-range value will
be included in the average for the duration of the averaging period (e.g., with a
1000 millisecond running average, the over-range will be the value from the
PulseCount(...)
instruction until 1 second has passed. Resetting the average
prior to (re)starting the scan avoids this.
ReadIO (Dest, PSlot, Mask)
ReadIO is used to read the status of selected digital I/O channels (ports) on the
CR9070/CR9071E Counter - Timer / Digital I/O Module. There are 16 ports on
the CR9070/CR9071E. The status of these ports is considered to be a binary
number with a high port (+5 V) signifying 1 and a low port (0 V) signifying 0.
For example, just looking at the first 8 ports, if ports 1 and 3 are high and the
rest low, the binary representation is 00000101, or 5 decimal. The mask
parameter is used to select which of the ports to read, it too is a binary
representation of the ports, a 1 means pay attention to the status of the port, a 0
means ignore the status of the port (the mask is "anded" with the port status; the
"and" operation returns a 1 for a digit if the mask digit and the port status are
both 1 and a 0 if either or both is 0). CRBasic allows the entry of numbers in
Summary of Contents for CR9000
Page 6: ...CR9000 Table of Contents iv This is a blank page ...
Page 22: ...CR9000 Overview OV 16 This is a blank page ...
Page 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Page 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Page 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Page 217: ...This is a blank page ...