Section 7. Installation
SlowSequence
'Begin slow sequence
'Declare Public Variables for Secondary Scan (can be declared at head of program)
Public
Batt_Volt
Public
Counter2
'Declare Data Table
DataTable
(DataTable2,1,-1)
'DataTable2 is event driven.
'The event is the scan.
Sample
(1,Batt_Volt,FP2)
Sample
(1,Counter2,FP2)
EndTable
Scan
(5,Sec,0,0)
'Begin 1st secondary scan
Counter2 = Co 1
Battery
(Batt_Volt)
CallTable
DataTable2
'Call DataTable2
NextScan
'End slow sequence scan
EndProg
'End executable section of program
7.9.2 Compiling: Conditional Code
When a CRBasic user program is sent to the CR1000, an exact copy of the
program is saved as a file on the
CPU: drive
(p. 371).
A binary version of the
program, the "operating program", is created by the CR1000 compiler and written
to
Operating Memory
(p. 372).
This is the program version that runs the CR1000.
CRBasic allows definition of conditional code, preceded by a hash character (#),
in the CRBasic program that is compiled into the operating program depending on
the conditional settings. In addition, all Campbell Scientific datalogger (except
the CR200) accept program files, or
Include()
instruction files, with .DLD
extensions. This feature circumvents system filters that look at file extensions for
specific loggers; it makes possible the writing of a single file of code to run on
multiple models of CRBasic dataloggers.
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
This logic allows a simple change of a constant to direct, for instance, which
measurement instructions to include.
CRBasic Editor
now 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
180
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......