Specifications
4-1
Section 4. CRBasic - Native Language
Programming
The CR3000 is programmed in a language that has some similarities to a structured basic.
There are special instructions for making measurements and for creating tables of output
data. The results of all measurements are assigned variables (given names).
Mathematical operations are written out much as they would be algebraically. This
section describes a program, its syntax, structure, and sequence.
4.1 Format Introduction
4.1.1 Mathematical Operations
Mathematical operations are written out much as they would be algebraically.
For example, to convert a temperature in Celsius to Fahrenheit one might
write:
TempF = TempC * 1.8 + 32
With the CR3000 there may be many temperature (or other) measurements.
For example, sixteen thermocouples could be attached to the CR3000 to
measure temperature at fourteen locations. Rather than have 14 different
names, a variable array with one name and 14 elements may be used. A
thermocouple temperature might be called TCTemp. With an array of 14
elements the names of the individual temperatures are TCTemp(1),
TCTemp(2), TCTemp(3), ... TCTemp(14). The array notation allows compact
code to perform operations on all the variables. For example, to convert ten
temperatures in a variable array from C to F:
For I=1 to 10
TCTemp(I)=TCTemp(I)*1.8+32
Next I
4.1.2 Measurement and Output Processing Instructions
Measurement instructions are procedures that set up the measurement
hardware to make a measurement and place the results in a variable or a
variable array. Output processing instructions are procedures that store the
results of measurements or calculated values. Output processing includes
averaging, saving maximum or minimum, standard deviation, FFT, etc.
The instructions for making measurements and outputting data are not found in
a standard basic language. The instructions Campbell Scientific has created
for these operations are in the form of procedures. Each procedure has a
keyword name and a series of parameters that contain the information needed
by the CR3000 to complete the procedure. For example, the instruction for
measuring the temperature of the CR3000 input panel is:
PanelTemp (Dest, Integ)