Section 7. Installation
257
the CR200X) accept program files, or
Include()
instruction files, with .DLD
extensions.
Note
Do not confuse CRBasic files with .DLD extensions with files of
.DLD type used by legacy Campbell Scientific dataloggers.
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 CR800, which may help keep costs down over very
expensive comms links.
CRBasic example
Conditional Code
(p. 257)
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 CR800 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"
Содержание CR800 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 34: ......
Страница 54: ......
Страница 92: ......
Страница 190: ...Section 7 Installation 190 FIGURE 40 Running Average Frequency Response FIGURE 41 Running Average Signal Attenuation ...
Страница 310: ......
Страница 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Страница 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Страница 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Страница 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Страница 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Страница 456: ......
Страница 462: ......
Страница 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Страница 524: ......
Страница 526: ......
Страница 556: ......
Страница 558: ......
Страница 560: ......
Страница 597: ......