File management via powerup.ini

Another way to upload a program, install a data logger OS, or format a drive is to create a powerup.ini file. The file is created with a text editor and saved to a memory card or SC115 with the associated files. Alternatively, the powerup.ini file and associated files can be saved to the data logger using the Closeddata logger support software LoggerNet, RTDAQ, and PC400 - these Campbell Scientific software applications include at least the following functions: data logger communications, downloading programs, clock setting, and retrieval of measurement data. File Control > Send command. With the memory card or SC115 connected, or with the powerup.ini file saved in the data logger memory, a power cycle to the data logger begins the process chosen in the powerup.ini file.

  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 Default program for more information.

Syntax for the powerup.ini file and available options follow.

Syntax

Syntax for powerup.ini is:

Command,File,Device

where,

  • Command is one of the numeric commands in the following table.
  • File is the accompanying operating system or user program file.
  • Device is the data logger memory drive to which the accompanying operating system or user program file is copied (usually CPU). If left blank or with an invalid option, default device will be CPU. Use the same drive designation as the transporting external device if the preference is to not copy the file.
WARNING:

Uploading a program, installing a data logger OS, or formatting a drive may result in data loss. Depending on several factors, the data logger may also become incapacitated for a time. It is recommended that you retrieve data from the data logger and back up your programs before sending a powerup.ini file; otherwise, data may be lost. To collect data using LoggerNet, connect to your data logger and click Collect Now . To backup your data logger, connect to it in Device Configuration Utility, click the Backup menu and select Backup Datalogger.

Powerup.ini commands

Command Action Details
1 Run always,
preserve data
Copies a program file to a drive and sets the program to both Run Now and Run on Power Up. Data on a memory card from the previously running program will be preserved if table structures have not changed.
2 Run on
power up
Copies a program file to a drive and sets the program to Run Always unless command 6 or 14 is used to set a separate Run Now program.
5 Format Formats a drive.
6 Run now,
preserve data
Copies a program file to a drive and sets the program to Run Now. Data on a memory card from the previously running program will be preserved if table structures have not changed.
7 Copy
support files
Copies a file, such as an ClosedInclude A file containing CRBasic code to be included at the end of the current CRBasic program, or it can be run as the default program. or program support file, to the specified drive.
9 Load OS
(File= .obj)
Loads an .obj file to the CPU drive and then loads the .obj file as the new data logger operating system.
13 Run always,
erase data
Copies a program to a drive and sets the program to both Run Now and Run on Power Up. Data on a memory card from the previously running program will be erased.
14 Run now,
erase data
Copies a program to a drive and sets the program to Run Now. Data on a memory card from the previously running program will be erased.
15 Move file Moves a file, such as an ClosedInclude A file containing CRBasic code to be included at the end of the current CRBasic program, or it can be run as the default program. or program support file, to the specified drive.

Example powerup.ini files

Comments can be added to the file by preceding them with a single-quote character ('). All text after the comment mark on the same line is ignored.

TIP:

Test the powerup.ini file and procedures in the lab before going to the field. Always carry a laptop or mobile device (with data logger support software) into difficult- or expensive-to-access places as backup.

Example: Code Format and Syntax

'Command = numeric power up command

'File = file associated with the action

'Device = device to which File is copied. Defaults to CPU

'Command,File,Device
13,Write2CRD_2.CR1X,cpu:

Example: Run Program on Power Up

'Copy program file pwrup.CR1X from the external drive to CPU:
'File will run only when the data logger is powered-up later.
2,pwrup.CR1X,cpu:

Example: Format the USR Drive

5,,usr:

Example: Send OS on Power Up

'Load an operating system (.obj) file into FLASH as the new OS

9,CR1000X.Std.01.obj

Example: Run Program from SC115 Flash Memory Drive

'A program file is carried on an SC115 Flash Memory drive.
'Do not copy program file from SC115
'Run program always, erase data.

13,toobigforcpu.CR1X,usb:

Example: Always Run Program, Erase Data

13,pwrup_1.CR1X,cpu:

Example: Run Program Now and Erase Data Now

14,run.CR1X,cpu: