Section 7. Installation
CRBasic Program Structure
Units
Optional. Assign engineering units to variables. Units are
not active code. The CR800 makes no use of units nor
checks unit accuracy.
DataTable
Sample()
Average()
Maximum()
Minimum()
Define stored-data tables.
• Process or store trigger: set triggers when data should
be stored. Triggers may be a fixed interval, a condition,
or both.
• Set the size of a data table.
• Send data to a Campbell Scientific mass storage device
if available.
BeginProg
Begin the action part of the program.
Scan()
Set the interval for a series of measurements.
Measurements Make measurements.
Processing Process measurement and other data.
CallTable()
Call data tables to process and store data.
Controls Check measurements and initiate any control actions.
NextScan
Loop back to Scan() and wait for the next scan.
EndProg
End the program.
1
Fine points:
• Maximum program-line length is 512 characters.
• Maximum constant-name length is about 500 characters.
• Processes or calculations repeated during program execution can be packaged in a
subroutine and called when needed rather than repeating the code each time.