Section 7. Installation
7.8.1 Program Structure
Essential elements of a CRBasic program are listed in the table
CRBasic Program
Structure
(p. 123)
and demonstrated in CRBasic example
Program Structure
(p. 123).
Table 8.
CRBasic Program Structure
Declarations
Define CR1000 memory usage. Declare constants,
variables, aliases, units, and data tables.
Declare constants
List fixed constants.
Declare
Public
variables
List / dimension variables viewable during program
execution.
Declare
Dim
variables
List / dimension variables not viewable during
program execution.
Define
Alias
es
Assign aliases to variables.
Define
Units
Assign engineering units to variable (optional).
Units are strictly for documentation. The CR1000
makes no use of Units nor checks Unit accuracy.
Define data tables.
Define stored data tables.
Process / store trigger
Set triggers when data should be stored. Triggers
may be a fixed interval, a condition, or both.
Table size
Set the size of a data table.
Other on-line storage devices
Send data to a Campbell Scientific mass storage
device or memory card if available.
Processing of data
List data to be stored in the data table, e.g. samples,
averages, maxima, minima, etc.
Processes or calculations repeated during program
execution can be packaged in a subroutine and
called when needed rather than repeating the code
each time.
Begin program
Begin program defines the beginning of statements
defining CR1000 actions.
Set scan interval
The scan sets the interval for a series of
measurements.
Measurements
Enter measurements to make.
Processing
Enter any additional processing.
Call data table(s)
Declared data tables must be called to process and
store data.
Initiate controls
Check measurements and initiate controls if
necessary.
NextScan
Loop back to set scan and wait for the next scan.
End program
End program defines the ending of statements
defining CR1000 actions.
123
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......