Print list of variables or quoted text, Rundldfile – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 218

Advertising
background image

Section 9. Program Control Instructions

9-12

Power off can also be used in conjunction with the power-up digital inputs to set up
the CR5000 to power up in response to external trigger, make a series of
measurements, and then power off.

If the "<0.5 " input is switched to ground or if the ">2" input has a voltage
greater than 2 volts applied, the CR5000 will awake, load the program in
memory and run. If the "< 0.5" input is held at ground and off/on switch
turned off then on, the CR5000 will not run the program in memory. This is
extremely useful if the program executes the PowerOff instruction immediately
or after a short measurement period.

The following example is a good one to play with to become familiar with the
PowerOff instruction. The CR5000 "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 to wake the CR5000 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

Print list of variables or quoted text

Print is used as a tool in debugging a program to print text or the value of
variables at different points in the program. “ Printing” occurs over the active
link and can be observed from Tools | Diagnostics | Terminal Mode in PC9000.

RunDLDFile

The RunDLDFile instruction is used to run a datalogger program file from the
active program file.

Syntax
RunDLDFile( "Device:FileName", Attrib )

Remarks
The RunDLDFile has the following parameters:

"Device:FileName"

The "Device:Filename" argument is the file that should
be executed. The Device on which the file is stored
must be specified and the entire string must be enclosed
in quotation marks. Device = CPU, the file is stored in
datalogger memory. Device = CRD, the file is stored on
a PCMCIA card.

Attribute

The Attribute is a numeric code to determine what
should happen to the file called by the RunDLDFile

Advertising