beautypg.com

Subscan (subinterval, units, subratio), Subscan parameters – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 270

background image

Section 7. Measurement Instructions

7-46

The following example program measures 6 channels on the CR9052DC using the VoltFilt instruction.

' CR9052 example program #1
'' Measure six channels at 1 kHz on +/- 5000 mV range with 5-Volt excitation.
‘ Sample ratio is 2.5: top of pass band is 1 kHz / 2.5 = 400 Hz.
‘ CR9052 is in slot 8.

Public

sig_in (6)

Units

sig_in = mV

Public

flag (1)

DataTable

(FiltData, flag (1), -1)

' save to final storage if flag (1) = True

Sample

(6, sig_in(1),IEEE4)

EndTable

BeginProg

Scan

(1, msec, 0,0)

'

VoltFilt (Destination, Reps, Range, Fslot, Chan, FiltOption, Excitation, Mult, Offset)

VOLTFILT

(sig_in(1), 6, mV5000, 8, 1, 2, 5, 1.0, 0.0)

CallTable

FiltData

Next Scan
EndProg

SubScan (SubInterval, Units, SubRatio)

The SubScan instruction makes it possible to measure CR9052 inputs at one
rate and measurements on other modules at a slower rate, all within the same
scan structure. The number of SubScans that will be buffered is the product of
the SubRatio parameter and the Scan's Buffer parameter. When the program
contains a VoltFilt instruction within a SubScan, the Filter module will buffer
the Scans to its onboard memory. If the main Scan instruction specifies more
scans to buffer than available CR9052 memory, an error message will be
returned at compile time. You cannot run measurements for a single CR9052
module both inside and outside of a SubScan, as all measurements for a given
module must have the same Scan Interval and Sample Ratio.

See the SubScan Topic in Section 9.1 Program Structure/Control for more
information on setting up measurements in SubScans.

This instruction cannot be used in a Slow Sequence Scan.

Parameter
& Data Type

Enter

SUBSCAN PARAMETERS

SubInterval

Constant

The time interval at which to run the subscan. The interval must be one of the valid intervals
for the CR9052 module: 20, 40, 100, 200, or 400 microseconds or 1, 2, 4, 10, 20, 40, 100, or
200 milliseconds. When used with the CR9052 Filter Module, the interval of the scan that
contains the SubScan must be an integral multiple of the SubScan interval.

Units

The units for the Interval

Constant

Alpha
Code

Numeric
Code


Units

USEC 0

Microseconds

MSEC 1

Milliseconds

SubRatio

Constant

The subscan will run SubRatio times each time the scan runs. When SubScan is used with the
CR9052 Filter Module (the only use as of March 2001) this parameter is redundant but must
be entered anyway. (The Scan interval must be an integral multiple of the SubScan interval or
a compile error will occur. SubRatio is the ratio between the scan interval and the subscan
interval.)

NOTE