10 crbasic measurement instructions, 1 moduletemp measurement instruction – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 157

Advertising
background image

Section 4. CRBasic – Native Language Programming

In most applications, it is highly recommended to perform background
calibration in the SlowSequence Scan. If calibration is not done as part of the
program, a typical shift in the calibration is 0.01 % per degree C change from
the temperature at which the program compile calibration occurred.

See Section 9.2 DataLogger Status/Control for information on Calibrate &
BiasComp.

Example program 4.2.9-5 has a SlowSequence program area with a
Scan/NextScan bracketing the Calibrate and BiasComp instructions.

Example Program 4.2.9-5

Public Accel
DataTable (Main1,1,-1)

DataInterval (0,0,0,100)

'Synch the output rate to the SubScan rate

Sample (1,Accel,IEEE4)

EndTable

'PROGRAM: MAIN SEQUENCE

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

'LOW PRIORITY BACKGROUND SEQUENCE

SlowSequence

'Used for slow measurements/Background Calibration

Scan(10,Sec,0,0)

'Scan once every 10 seconds

Calibrate

'Corrects ADC offset and gain

BiasComp

'Corrects ADC bias current

Next

Scan

'Loop up for the next scan

EndProg

4.2.10 CRBasic Measurement Instructions

CRBasic includes instructions specifically designed for making measurements
and storing the result to variables. Each instruction has a keyword name and a
series of parameters that contain the information needed to complete the
measurement. Measurement instructions must be placed within a
Scan/NextScan construct. This section will cover a couple measurement
instructions to give examples on how to set up a program.

See Section 7 Measurement Instructions for information on Measurement
instructions.

4.2.10.1 ModuleTemp Measurement Instruction

The instruction for measuring the temperature of the CR9050 modules reference
PRT is: ModuleTemp (Dest,Reps,Slot,Integ)

ModuleTemp is the keyword name of the instruction. The four parameters
associated with ModuleTemp are:

Destination: the name of the variable in which to put the temperature
Reps:

the number of modules you want to measure the PRTs of,

Slot

the slot number where the first module resides, and

Integration: the length of time to integrate the measurement.

4-29

Advertising