2 use of move() to conserve code space, 8 programming resource library, 1 cal files – Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 151: Table 21. abbreviations of names of data processes

Advertising
background image

Section 7. Installation

151

 

CRBasic Example 24. Use of Variable Arrays to Conserve Code Space 

For

I = 1

to

20

TCTemp(I) = TCTemp(I) * 1.8 + 32

Next

I

 

7.7.4.2 Use of Move() to Conserve Code Space

The Move() instruction can be used to set an array or partial array to a single
value or to copy to another array or partial array as shown in CRBasic example
Use of Move() to Conserve Code Space

(p. 151).

CRBasic Example 25. Use of Move() to Conserve Code Space 

Move

(counter(1),6,0,1)

'Reset six counters to zero. Keep array

'filled with the ten most current readings

Move

(TempC(2),9,TempC(1),9)

'Shift previous nine readings to make room

'for new measurement

'New measurement:

TCDiff

(TempC(1),1,mV2_5C,8,TypeT,PTemp,True,0,_60Hz,1.0,0)

 

7.8 Programming Resource Library

This library of notes and CRBasic code addresses a narrow selection of CR800
applications. Consult a Campbell Scientific applications engineer if other
resources are needed.

7.8.1 Calibration Using FieldCal() and FieldCalStrain()

Calibration increases accuracy of a sensor by adjusting or correcting its output to
match independently verified quantities. Adjusting a sensor's output signal is
preferred, but not always possible or practical. By using the FieldCal() or
FieldCalStrain() instruction, a linear sensor output can be corrected in the CR800
after the measurement by adjusting the multiplier and offset.

When included in the CR800 CRBasic program, FieldCal() and FieldCalStrain()
can be engaged through a support software calibration wizard

(p. 427).

Help for

using the wizard is available in the software. A more arcane procedure can be
executed though the CR1000KD Keyboard / Display Display or the numeric
monitor in any version of datalogger support software. The numeric monitor
procedure is used in the examples below to clearly illustrate the workings of the
calibration functions.

7.8.1.1 CAL Files

Calibration data are stored automatically, usually on the CR800 CPU: drive, in
CAL files. These data become the source for calibration factors when requested
by the LoadFieldCal() instruction. A CAL file is created automatically on the
same CR800 memory drive and given the same name (with .cal extension) as the
program that creates and uses it. For example, the CRBasic program file
CPU:MyProg.cr8 generates the CAL file CPU:MyProg.cal.

CAL files are created if a program using FieldCal() or FieldCalStrain() does not
find an existing, compatible CAL file. Files are updated with each successful

Advertising