beautypg.com

Get record(dest, tablename, recsback), Instructiontimes(dest) – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 372

background image

Section 9. Program Control Instructions

Get Record(Dest, TableName, RecsBack)

Retrieves one record from a data table.

Syntax

GetRecord

( Dest, TableName, RecsBack )

Remarks
The GetRecord instruction retrieves one entire record from a data table. The
destination array must be dimensioned large enough to hold all the fields in the
record. A record can also be retrieved based on time by entering a negative
value, in seconds since 1990, in the RecsBack parameter. See the
SecsSince1990 topic in this section for a method to calculate the seconds since
1990 based on a date and time.

Parameter
& Data Type

Enter

GETRECORD PARAMETERS

Dest
Array

The destination variable array in which to store the fields of the record. The array must be
dimensioned large enough to hold all the fields in the record.

TableName

name

The name of the data table to retrieve the record from.

RecsBack
Const. Or
variable

The number of records back from the most recent record stored to go to retrieve the record (1
record back is the most recent). A negative number can be entered for the RecsBack parameter
to specify the time, in seconds since 1990, for the record to be retrieved.

InstructionTimes(Dest)

The InstructionTimes instruction returns the processing time required for
each instruction in the program.

Syntax
InstructionTimes(
Dest)

Remarks

The InstructionTimes instruction loads the Dest array with processing time
(microseconds) for each instruction in the program. InstructionTimes must
appear before the BeginProg statement in the program.

Each element in the array corresponds to a line number in the program. To
accommodate all of the instructions in the program, the array must be
dimensioned to the total number of lines in the program, including blank lines
and comments. The Dest array must also be dimensioned as a long integer

(e.g.,

Public Array(20) AS LONG).

Note that the processing time for an instruction may vary. For instance, it will
take longer to execute instructions when the datalogger is communicating with
another device.

InstructionTimes can be inserted into a program that is returning
a variable out of bounds error to indicate which variable is in
error.

TIP

InstructionTimes Example

The following program measures battery voltage, panel temperature, and a
thermocouple. There are 20 lines in the program, so the Itimes() Destination
array for InstructionTimes is dimensioned to 20.

9-42