Default program

Many data logger settings can be changed remotely over a communications link. This convenience comes with the risk of inadvertently changing settings and disabling communications. For example, external cellular modems are often controlled by a switched 12 VDC (SW12V) terminal. SW12V is normally off; so, if the program controlling SW12V is disabled, such as by changing a setting or sending a new operating system, the cellular modem is switched off and the remote data logger will not turn it on. This could require an on-site visit to correct the problem unless a special program called default has been installed.

Having a default.CR300 program stored on the data logger will also ensure that a non-compiling CRBasic program does not lock out a remote user.

NOTE:

The default program may use the extension .CR300,.CRB or .DLD.

When a file named default.CR300 is stored on the data logger CPU: drive, it is loaded if no other program takes priority. Program execution priorities are as follows: 

  1. When the CR300 series powers up, a program file marked as Run On Power-up will run. If that program includes a file specified by the Include File setting, it will be incorporated into the program that runs.
  2. If there is no program file marked Run Now or Run On Power-up (or if the program selected to run cannot be compiled), the data logger will run the program specified by the IncludeFile setting. For more information see IncludeFile.
  3. If the IncludeFile program cannot be compiled or if no program is specified, the data logger will attempt to run the program named default.CR300 on its CPU: drive.
  4. If there is no default.CR300 file or it cannot be compiled, the CR300 series will not automatically run any program.

The default.CR300 program generally contains instructions to preserve critical datalogger settings such as communications settings, but should not be more than a few lines of code.

default.CR300 example

'This program turns ON the SW12V switched

'power terminal, for 30 seconds every 60 seconds.

BeginProg

Scan(1,Sec,0,0)

If TimeIsBetween (15,45,60,Sec) Then SW12(1)

NextScan

EndProg

Downloading operating systems over communications requires much of the available CR300 series memory. If the intent is to load operating systems via a communications link and have a default.CR300 file in the CR300 series, the default.CR300 program should not allocate significant memory, as might happen by allocating a large USR: drive. Also, do not auto-allocate tables in DataTable() instructions; if it is necessary to use DataTable() instructions, set small fixed table sizes. Refer to Sending an operating system to a remote data logger for information about sending the operating system.