Campbell Scientific CR3000 Micrologger User Manual

Page 519

Advertising
background image

Appendix A. CRBasic Programming Instructions

519

 

FileOpen 
Opens an ASCII text file or a binary file for writing or reading. 

Syntax 

FileHandle = FileOpen("FileName", "Mode", SeekPoint)

FileRead 
Reads a file referenced by FileHandle and stores the results in a variable or 
variable array. 

Syntax 

FileRead(FileHandle, Destination, Length)

FileReadLine 
Reads a line in a file referenced by a FileHandle and stores the result in a variable 
or variable array. 

Syntax 

FileReadLine(FileHandle, Destination, Length)

FileRename 
Changes the name of file on a CR3000 drive. 

Syntax 

FileRename(drive:OldFileName, drive:NewFileName)

FileSize 
Returns the size of a file stored in CR3000 memory. 

Syntax 

FileSize(FileHandle)

FileTime 
Returns the time the file specified by the FileHandle was created. 

Syntax 

Variable = FileTime(FileHandle)

FileWrite 
Writes ASCII or binary data to a file referenced in the program by FileHandle. 

Syntax 

FileWrite(FileHandle, Source, Length)

Include 
Inserts code from a file (Filename) at the position of the Include () instruction at 
compile time. Include cannot be nested. 

Syntax 

Include("Device:Filename")

NewFile 
Determines if a file stored on the datalogger has been updated since the 
instruction was last run. Typically used with image files. 

Syntax 

NewFile(NewFileVar, "FileName")

Advertising