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 (SW12) terminal. SW12 is normally off; so, if the program controlling SW12 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.CR1X 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 .CR1X,.CRB or .DLD.

When a file named default.CR1X 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 CR1000X/CR1000Xe powers up, it executes commands in the powerup.ini file (on an attached USB drive or memory card) including commands to set the CRBasic program file attributes to Run Now or Run On Power-up.
  2. When the CR1000X/CR1000Xe 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.
  3. 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.
  4. If the IncludeFile program cannot be compiled or if no program is specified, the data logger will attempt to run the program named default.CR1X on its CPU: drive.
  5. If there is no default.CR1X file or it cannot be compiled, the CR1000X/CR1000Xe will not automatically run any program.

See File management via powerup.ini for more information.

The default.CR1X 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.CR1X example

'This program turns ON the SW12 switched

'power terminal, for 30 seconds every 60 seconds.

BeginProg

Scan(1,Sec,0,0)

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

NextScan

EndProg

Downloading operating systems over communications requires much of the available CR1000X/CR1000Xe memory. If the intent is to load operating systems via a communications link and have a default.CR1X file in the CR1000X/CR1000Xe, the default.CR1X 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.

Execution of default.CR1X at power-up can be aborted by holding down the DEL key on a CR1000KD Keyboard/Display.