beautypg.com

1 cr9052dc/cr9052iepe filter module subscan – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 154

background image

Section 4. CRBasic – Native Language Programming

4.2.9.2.1 CR9052DC/CR9052IEPE Filter Module SubScan

Any SubScan that includes a VoltFilt or a FFTFilt measurement instruction is
considered a Filter Module SubScan. Only one of these two measurement
instructions should be placed in a single Filter SubScan construct. Also, a
single CR9052 module can only support one measurement rate, so one
CR9052 cannot support both instruction types in a single program. For
this same reason, measurements for a single CR9052 cannot be placed
inside and outside of a SubScan. Normally all measurements for each
CR9052 are placed in a single SubScan/NextSubScan loop.
Multiple
SubScans can exist within a given Scan when using multiple CR9052 modules.

The parameters for the CR9052 Subscan are:

SubInterval: Constant that dictates the scan interval of the filter module

whose instructions are within the SubScan. Must be one of
the legal Scan intervals for the CR9052 (see Appendix B for
list of available scan intervals). Also, the interval of the main
Scan where the Subscan resides must be an integral multiple
of the SubScan interval. Minimum SubScan value is 20
microseconds, maximum is 200 milliseconds

Units:

Units used for the SubInterval.

SubRatio

Integral ratio of the main Scan interval to the SubScan

interval.

When the program contains a VoltFilt instruction within a
SubScan, the Filter module will buffer the Scans to its onboard
memory. When using CR9052s with Scan rates faster than 1000
Hz, the CR9052s' measurement instructions should be placed in a
SubScan construct and the main Scan buffer parameter should be
set to as high a value as possible for more efficient transferring of
data from the Filter buffer to the CR9032 CPU.

NOTE

Example program 4.2.9-2 sets up a Filter module to make 1000 Hz
measurements (once a second) using a SubScan within a main Scan of 1 Hz.
Note the high number of Scan buffers created by the Scan instruction.

Example Program 4.2.9-2: SubScan with VoltFilt

Public Accel
DataTable (Main1,1,-1)
DataInterval (0,0,0,100)

'Synch the output rate to the SubScan rate

Sample (1,Accel,IEEE4)
EndTable
BeginProg

Scan (1,Sec,1000000,0)

'Scan once a second, 1,000,000 Scan buffers

SubScan (1,mSec,1000)

'1000/1 SubScan/Scan ratio

VoltFilt (Accel(),1,mV200,5,1,2,7,1.0,0)
CallTable Main1

'Call Table from SubScan to output at its rate.

NextSubScan
NextScan
EndProg

4-26