beautypg.com

Powerup.ini – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 377

background image

Section 9. Program Control Instructions

The following example is a good one to use to become familiar with the
PowerOff instruction. The CR9000X "scans" once a second for two minutes.
At the end of that time it powers down. It is programmed to wake up on a 4
minute interval. After the first PowerOff, it will wake up every four minutes,
count for 2 minutes and turn itself off. You can load this program and use the
Power On inputs on the 9011 Module to wake the CR9000X before the
interval is up. A program for an actual application would have measurements
within the scan.

Public Start(6), count

'Declare the start time array and count

'Start() is initialized to 0 at compile time. 0 time is Midnight the start of 1990

'count is initialized to 0 at compile time

BeginProg

Scan(1,SEC,0,120)

'Scan once per second for 2 minutes

Count=count+1

'Increment counter

NextScan

POWEROFF

(Start,4,min)

'Power off, wake up on 4 minute interval

EndProg

Powerup.ini

At datalogger power-up, if a card that has a powerup.ini file resides in the PC
card slot, then the powerup.ini file will be parsed and a series of commands
can be executed prior to compiling and running a program.

Syntax

Command,File,Device

Remarks

Program File run hierarchy:

1. When the datalogger first starts, it will execute any commands found in

the

Powerup.ini

file, if present. This can include a command to set the

run attribute(s) of program file(s) to Run now and run on power-up,
Run-now, or Run on power up.

2. Next, any file, located on the Card or CPU, that is marked with a run

attribute of Run now and Run on power up (Run Always) or Run now
will be the "current program". If no program with either of these
attributes exist, any program with the attribute of Run on power-up will
start running.

3. If the program set to run by the settings in step 2 cannot be run, or if no

program is specified, the datalogger will attempt to run any program
named default.c9x that exists on its CPU: drive.

4. If there is no default.c9x file on the CPU, or if that file cannot be

compiled, the datalogger will not run any program.

9-47