Section 9. Datalogger Program Creation with CRBasic Editor
Program
The program section defines the action of
datalogging.
Set scan interval
The scan sets the interval for a series of
measurements.
Measurements
Enter the measurements to make.
Processing
Enter any additional processing with the
measurements.
Call Data Table(s)
The Data Table must be called to process
output data.
Initiate controls
Check measurements and Initiate controls if
necessary.
NextScan
Loop back (and wait if necessary) for the next
scan.
End Program
9.4.2 Program Declarations
Variables must be declared before they can be used in the program. Variables
declared as
Public
can be viewed in display software. Variables declared
using
Dim
cannot be viewed. Variables assigned to a fixed value are used as
constants.
For example, in a CRBasic program there may be multiple temperature (or
other) sensors that are wired to sequential channels. Rather than insert
multiple instructions and several variables, a
variable array
with one name and
many elements may be used. A thermocouple temperature might be called
TCTemp. With an array of 20 elements the names of the individual
temperatures are TCTemp(1), TCTemp(2), TCTemp(3), ... TCTemp(20). The
array notation allows compact code to perform operations on all the variables.
For example, to convert ten temperatures in a variable array from C to F:
For I=1 to 10
TCTemp(I)=TCTemp(I)*1.8+32
Next I
Aliases can also be created that will allow an element of an array or another
data result to be referred to by a different name. To continue the example
above, TCTemp(3) could be renamed using the following syntax:
Alias TCTemp(3) = AirTemp
In the display software, the more descriptive alias, AirTemp, would be used for
the cell name.
9.4.3 Mathematical Expressions
Mathematical expressions can be entered algebraically into program code to
perform processing on measurements, to be used for logical evaluation, or to
be used in place of some parameters.
9-19
Summary of Contents for PC400
Page 2: ......
Page 16: ...Section 1 Introduction 1 6...
Page 18: ...Section 2 System Requirements 2 2...
Page 46: ...Section 4 The PC400 Main Screen 4 24...
Page 49: ...Section 5 Split 5 3...
Page 82: ...Section 5 Split 5 36...
Page 114: ...Section 6 View 6 14...
Page 132: ...Section 7 Short Cut Program Generator 7 18...
Page 188: ...Section 9 Datalogger Program Creation with CRBasic Editor 9 30...
Page 230: ...Appendix B Table Based Dataloggers B 12...
Page 249: ......