Filemanage – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 212

Advertising
background image

Section 9. Program Control Instructions

9-6

Alternatively, the same thing can be accomplished by incorporating the range
test in the Do...Loop as follows:

Dim Reply

'Declare variable.

Do

Reply = Volt(1)

Loop Until Reply > 1 And Reply < 9
The next example show the use of Wend.
While X > Y

'Old fashioned way of looping.

.........
.........
Wend

Do While X > Y

'Much better

.........
.........
Loop

FileManage

The FileManage instruction is used to manage files from within a running
datalogger program.

Syntax
FileManage( "Device: FileName", Attribute )

Remarks
FileManage is a function that allows the active datalogger program to
manipulate program files that are stored in the datalogger.

The FileManage instruction has the following parameters:

Parameter
& Data Type

Enter

Device;
Filename
Text

The "Device:Filename" argument is the file that should be manipulated. 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
Constant

The Attribute is a numeric code to determine what should happen to the file
affected by the FileManage instruction. The Attribute codes are actually a
bit field. The codes are as follows:
Bit

Decimal

Description

bit 0

1

Program not active

bit 1

2

Run on power up

bit 2

4

Run now

bits 1 & 2

6

Run now and on power up

bit 3

8

Delete

bit 4

16

Delete all

Advertising