Section 7. Installation
272
As an example, pseudo code using this feature might be written as:
Const Destination = LoggerType
#If Destination = 3000 Then
<code specific to the CR3000>
#ElseIf Destination = 1000 Then
<code specific to the CR1000>
#ElseIf Destination = 800 Then
<code specific to the CR800>
#ElseIf Destination = 6 Then
<code specific to the CR6>
#Else
<code to include otherwise>
#EndIf
For example, this logic allows a simple change of a constant to direct, which
measurement instructions to include.
CRBasic Editor features a pre-compile option that enables the creation of a
CRBasic text file with only the desired conditional statements from a larger
master program. This option can also be used at the pre-compiler command line
by using -p <outfile name>. This feature allows the smallest size program file
possible to be sent to the CR3000, which may help keep costs down over very
expensive comms links.
CRBasic example Conditional Code
(p. 272)
shows a sample program that
demonstrates use of conditional compilation features in CRBasic. Within the
program are examples showing the use of the predefined LoggerType constant
and associated predefined datalogger constants (6, 800, 1000, and 3000).
Conditional Code
'This program example demonstrates program compilation than is conditional on datalogger
'model and program speed. Key instructions include #If, #ElseIf, #Else and #EndIf.
'Set program options based on:
' LoggerType, which is a constant predefined in the CR3000 operating system
' ProgramSpeed, which is defined in the following statement:
Const
ProgramSpeed = 2
#If
ProgramSpeed = 1
Const
ScanRate = 1
'1 second
Const
Speed = "1 Second"
#ElseIf
ProgramSpeed = 2
Const
ScanRate = 10
'10 seconds
Const
Speed = "10 Second"
#ElseIf
ProgramSpeed = 3
Const
ScanRate = 30
'30 seconds
Const
Speed = "30 Second"
#Else
Const
ScanRate = 5
'5 seconds
Const
Speed = "5 Second"
#EndIf
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......