1 the fieldcal instruction – Campbell Scientific RTDAQ Software User Manual

Page 256

Advertising
background image

Section 9. Calibration and Zeroing

9.2 Writing Calibration Programs with the CRBasic

Editor

9.2.1 The FieldCal Instruction

If you wish to make measurements that will be calibrated as discussed above,
you should use the FieldCal instruction within the CRBasic program. When
the program is running in the datalogger, you can use the RTDAQ Calibration
Wizard to perform the actual calibrations (in real-time) on the sensors that were
previously designated for calibration. You can also perform a manual
calibration against a running program using the RTDAQ Monitor Data screen
(see Chapter 7) or from a keyboard display connected directly to the
datalogger.

The FieldCal instruction works together with other related CRBasic
instructions to complete the calibration task. These instructions are shown in
Table 9.2-1.

TABLE 9.2-1. The FieldCal Instruction “Family”

Instruction Description

FieldCal

This is the main calibration instruction. The CRBasic
program should contain one FieldCal instruction per
measurement requiring calibration. This instruction is
placed after the measurement instruction to which it applies.

LoadFieldCal

(optional) This instruction loads values into program
variables from the calibration file (*.cal), if it exists. It will
also indicate whether the attempt to load those values was
successful or not by returning a boolean (true/false) result.

SampleFieldCal (optional) This is a table output instruction. It writes the

latest calibration values for all calibrated measurements to a
data table (separate from the *.cal file).

NewFieldCal

(optional) This is a boolean system value indicating when a
calibration has succeeded. During one scan cycle after a
calibration has occurred this value will be true. Its value is
then set to false until another calibration occurs. The value
of this variable cannot be set within a CRBasic Program, but
only evaluated. The main purpose for this variable is to be
used together with the SampleFieldCal instruction to output
one table record per calibration to a specified table.

To set up a measurement for calibration in CRBasic, first insert the
instruction(s) that make the measurement, using variables for the multiplier
and/or offset. Then add a FieldCal instruction after the measurement
instruction and refer back to the measurement being calibrated using the
variable containing the measured output. Provide the FieldCal instruction with
the variables holding the multiplier and the offset of the measured sensor. If
you need to retrieve a calibration value into multipliers and offsets upon
program start or under other conditions, use the LoadFieldCal instruction. To
store calibration values to a data table (in addition to the values stored in the

9-2

Advertising