![Campbell CR9000 Instruction Manual Download Page 73](http://html1.mh-extra.com/html/campbell/cr9000/cr9000_instruction-manual_489197073.webp)
4-1
Section 4. CRBasic – Native Language
Programming
The CR9000 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 CR9000 there may be 5 or 50 temperature (or other) measurements.
Rather than have 50 different names, a
variable array
with one name and 50
elements may be used. A thermocouple temperature might be called TCTemp.
With an array of 50 elements the names of the individual temperatures are
TCTemp(1), TCTemp(2), TCTemp(3), ... TCTemp(50). 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. The procedure has a
keyword name and a series of parameters that contain the information needed
to complete the procedure. For example, the instruction for measuring the
temperature of the RTD on the 9050 Analog Input Module is:
ModuleTemp(
Dest, Reps, ASlot, Integ
)
Summary of Contents for CR9000
Page 6: ...CR9000 Table of Contents iv This is a blank page ...
Page 22: ...CR9000 Overview OV 16 This is a blank page ...
Page 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Page 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Page 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Page 217: ...This is a blank page ...