07.01.2015 Views

CR200/CR200X Series Dataloggers - Campbell Scientific

CR200/CR200X Series Dataloggers - Campbell Scientific

CR200/CR200X Series Dataloggers - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 9. Programming<br />

9.5 Structure<br />

TABLE. CRBASIC Program Structure (p. 72) delineates CRBASIC program<br />

structure:<br />

Table 6. 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 />

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 datalogger 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 program<br />

execution.<br />

Assign aliases to variables.<br />

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

are strictly for documentation. The <strong>CR200</strong>(X) makes no<br />

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

Define stored data tables<br />

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

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

Set the size of a data table<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 called<br />

when needed rather than repeating the code each time.<br />

Begin Program defines the beginning of statements<br />

defining datalogger actions.<br />

The scan sets the interval for a series of 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 necessary<br />

Loop back to Set Scan and wait for the next scan<br />

End Program defines the ending of statements defining<br />

datalogger actions.<br />

CRBASIC EXAMPLE. Proper Program Structure (p. 73) demonstrates the<br />

proper structure of a CRBASIC program.<br />

72

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

Saved successfully!

Ooh no, something went wrong!