Section 7. Installation
' CRBasic Editor, name it 'IncludeFile.cr1, and save it to the same PC folder on which
' resides the main program file (this make pre-compiling possible. Including the
' SlowSequence instruction as the first statement is required, followed by any other code.
'2. Send the 'include' file to the CPU: drive of the CR1000 using the File Control menu
' of the datalogger support software
(p. 654).
Be sure to de-select the Run Now and Run On
' Power-up options that are presented by the software when sending the file.
'3. Add the Include instruction to the main CRBasic program at the location from which the
' 'include' file is to be called (see the following code).
'4. Enter the CR1000 file system path and file name after the Include() instruction, as shown
' in the following code.
'
'IncludeFile.cr1 contains code to control power to a cellular phone modem.
'
'Cell phone + wire to be connected to SW12 terminal. Negative (-) wire
'to G.
Public
PTemp, batt_volt
DataTable
(Test,1,-1)
DataInterval
(0,15,Sec,10)
Minimum
(1,batt_volt,FP2,0,False)
Sample
(1,PTemp,FP2)
EndTable
BeginProg
Scan
(1,Sec,0,0)
PanelTemp
(PTemp,250)
Battery
(Batt_volt)
CallTable
Test
NextScan
Include
"CPU:IncludeFile.CR1"
'<<<<<<<<<<<<<<<'include' file code executed here
EndProg
CRBasic Example 13.
'Include' File to Control SW12 Terminal.
'This program example demonstrates the use of an 'include' file. See the documentation in CRBasic
example
'Using an Include File
(p. 149)
'
'<<<<<<<<<<<<<<<<<<<<<<<NOTE: No BeginProg instruction
SlowSequence
'<<<<<<<<<<NOTE: Begins with SlowSequence
Scan
(1,Sec,0,0)
If TimeIntoInterval
(9,24,Hr)
Then SW12
(1)
'Modem on at 9:00 AM (900 hours)
If TimeIntoInterval
(17,24,Hr)
Then SW12
(0)
'Modem off at 5:00 PM (1700 hours)
NextScan
'
'<<<<<<<<<<<<<<<<<<<<<<<NOTE: No EndProg instruction
7.8.4.10.4 Declaring Subroutines
Function()
/
EndFunction
instructions allow you to create a customized CRBasic
instruction. The declaration is similar to a subroutine declaration.
7.8.4.10.5 Declaring Incidental Sequences
A sequence is two or more statements of code. Data-table sequences are essential
150
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: ......