Section 9. Programming
72
9.5 Structure
TABLE. CRBASIC Program Structure
(p. 72) delineates CRBASIC program
structure:
Table 6.
CRBASIC Program Structure
Declarations
Define datalogger 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
Dimension variables
List / dimension variables not viewable during program
execution.
Define Aliases
Assign aliases to variables.
Define Units
Assign engineering units to variable (optional). Units
are strictly for documentation. The CR200(X) 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
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 datalogger 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
datalogger actions.
CRBASIC EXAMPLE. Proper Program Structure
(p. 73) demonstrates the
proper structure of a CRBASIC program.
Содержание CR200
Страница 32: ...Section 2 Quickstart Tutorial 22 ...
Страница 45: ...Section 3 Overview 35 3 3 Specifications ...
Страница 46: ...Section 3 Overview 36 ...
Страница 58: ...Section 4 Sensor Support 48 ...
Страница 62: ...Section 5 Measurement and Control Peripherals 52 ...
Страница 78: ...Section 8 CR200 X Configuration 68 ...
Страница 102: ...Section 9 Programming 92 ...
Страница 138: ...Section 11 Programming Resource Library 128 ...
Страница 156: ...Section 16 Support Software 146 ...
Страница 160: ...Section 17 Care and Maintenance 150 ...
Страница 166: ...Section 18 Troubleshooting 156 18 3 3 Diagnosis and Fix Procedures 18 3 3 1 Battery Voltage Test ...
Страница 167: ...Section 18 Troubleshooting 157 18 3 3 2 Charging Circuit Test Solar Panel ...
Страница 168: ...Section 18 Troubleshooting 158 18 3 3 3 Charging Circuit Test Transformer ...
Страница 169: ...Section 18 Troubleshooting 159 18 3 3 4 Adjusting Charging Circuit Voltage ...
Страница 170: ...Section 18 Troubleshooting 160 ...
Страница 184: ...Appendix A Glossary 14 ...
Страница 190: ...Appendix B Status Table and Settings 20 ...
Страница 192: ...Appendix C Serial Port Pin Outs 22 ...
Страница 211: ......