beautypg.com

2 default.cr3 file, 4 program run priorities – Campbell Scientific CR3000 Micrologger User Manual

Page 111

background image

Section 7. Installation

111

 

 

CRBasic Example 2.

"Include File" to Control SW12V‐1. 

'"Include File" "Add-on" Program

'Control Cellular modem power for the main program.

'Cell phone + to be wired to SW12V

-1

terminal, - to G.

'<<<<<<<<<<<<<<<<<<<<<<

SlowSequence

Scan

(1,Sec,0,0)

If TimeIntoInterval

(9,24,Hr)

Then SW12

(1,1)

'Modem on at 9:00 AM

If TimeIntoInterval

(17,24,Hr)

Then SW12

(1,0)

'Modem off at 5:00 PM

NextScan

'<<<<<<<<<<<<<<<<<<<<<<<<<<

 

7.6.3.3.2 Default.cr3 File

Default.cr3 can be stored on the CR3000 CPU: drive. At power up, the CR3000
loads default.cr3 if no other program takes priority (see Program Run Priorities

(p.

111)

). Default.cr3 can be edited to preserve critical datalogger settings such as

communication settings, but cannot be more than a few lines of code.

Downloading operating systems over telecommunications requires much of the
available CR3000 memory. If the intent is to load operating systems via
telecommunications and have a default.cr3 file in the CR3000, the default.cr3
program should not use significant memory, such as occurs by allocating a large
USR: drive, or by using a DataTable() instruction with auto allocation of
memory.

CRBasic Example 3.

Simple Default.cr3 File 

'This default.cr3 file controls the SW12V switched power terminal

BeginProg

Scan

(1,Sec,0,0)

If

TimeIntoInterval(15,60,Sec)

Then

SW12(1,1)

If

TimeIntoInterval(45,60,Sec)

Then

SW12(1,0)

NextScan

EndProg

 

7.6.3.4 Program Run Priorities

1. When the CR3000 starts, it executes commands in the powerup.ini file (on CF

card (CRD: drive) or Campbell Scientific mass-storage media (USB: drive)),
including commands to set program file (i.e., .cr3 files) attributes to Run Now
or Run On Power Up.

2. When the CR3000 powers up, a program file marked as Run On Power-up

will be the current program. Otherwise, any file marked as Run Now will be
used.

3. If there is a file specified in the Include File Name setting, it is compiled at

the end of the program selected in 1).

4. If there is no file selected in 1), or if the selected file cannot be compiled, the

CR3000 will attempt to run the program listed in the Include File Name
setting. The CR3000 allows a SlowSequence statement to take the place of