04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

Table 9. CRBasic Program Structure<br />

Declarations<br />

Declare constants<br />

Declare Public variables<br />

Dimension variables<br />

Define Aliases<br />

Define Units<br />

Define data tables.<br />

Process / store trigger<br />

Table size<br />

Other on-line storage devices<br />

Processing of data<br />

Begin program<br />

Set scan interval<br />

Measurements<br />

Processing<br />

Call data table(s)<br />

Initiate controls<br />

NextScan<br />

End program<br />

Define <strong>CR1000</strong> memory usage. Declare constants,<br />

variables, aliases, units, and data tables.<br />

List fixed constants.<br />

List / dimension variables viewable during program<br />

execution.<br />

List / dimension variables not viewable during<br />

program execution.<br />

Assign aliases to variables.<br />

Assign engineering units to variable (optional).<br />

Units are strictly for documentation. The <strong>CR1000</strong><br />

makes no use of Units nor checks Unit accuracy.<br />

Define stored data tables.<br />

Set triggers when data should be stored. Triggers<br />

may be a fixed interval, a condition, or both.<br />

Set the size of a data table.<br />

Send data to a CF card (CRD: drive) or <strong>Campbell</strong><br />

<strong>Scientific</strong> mass-storage media (USB: drive) if<br />

available.<br />

List data to be stored in the data table, e.g. samples,<br />

averages, maxima, minima, etc.<br />

Processes or calculations repeated during program<br />

execution can be packaged in a subroutine and<br />

called when needed rather than repeating the code<br />

each time.<br />

Begin program defines the beginning of statements<br />

defining <strong>CR1000</strong> actions.<br />

The scan sets the interval for a series of<br />

measurements.<br />

Enter measurements to make.<br />

Enter any additional processing.<br />

Declared data tables must be called to process and<br />

store data.<br />

Check measurements and initiate controls if<br />

necessary.<br />

Loop back to set scan and wait for the next scan.<br />

End program defines the ending of statements<br />

defining <strong>CR1000</strong> actions.<br />

CRBasic Example 6.<br />

Proper Program Structure<br />

'Declarations<br />

'Define Constants<br />

Const RevDiff = 1<br />

Const Del = 0 'default<br />

Const Integ = 250<br />

Const Mult = 1<br />

Const Offset = 0<br />

Declare constants<br />

113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!