9 the scan — measurement timing and processing, 9 the scan — measurement timing and processing -26, 1. formats for output data -26 – Campbell Scientific PC400 Datalogger Support Software User Manual

Page 188

Advertising
background image

Section 9. Datalogger Program Creation with CRBasic Editor

The output processing instructions included in a data table declaration
determine the values output in the table. The table must be called by the
program using the CallTable (Tablename) instruction in order for the output
processing to take. That is, each time a new measurement is made, the data
table is called. When the table is called, the output processing instructions
within the table process the current inputs. If the trigger conditions for the data
table are true, the processed values are output to the data table. In the example
below, several averages are output.

Average(Reps, Source, DataType, DisableVar)
Average(1,RefTemp,fp2,0)
Average(6,TC(1),fp2,0)

Average is an output processing instruction that will output the average of a
variable over the output interval. The parameters are repetitions (the number
of elements in an array to calculate averages for), the Source variable or array
to average, the data format to store the result in (TABLE 9-1), and a disable
variable that allows excluding readings from the average if conditions are not
met. A reading will not be included in the average if the disable variable is not
equal to 0; the example has 0 entered for the disable variable so all readings are
included in the average.

TABLE 9-1. Formats for Output Data

Code Data

Format

Size

Range

Resolution

FP2

Campbell Scientific floating point

2 bytes

±7999

13 bits (about 4 digits)

IEEE4

IEEE four byte floating point

4 bytes

1.8 E -38 to 1.7 E 38

24 bits (about 7 digits)

LONG

4 byte Signed Integer

4 bytes

-2,147,483,648 to
+2,147,483,647

1 bit (1)

9.4.9 The Scan — Measurement Timing and Processing

Once the measurements and calculations have been listed and the output tables
defined, the program itself may be relatively short. The executable program
begins with BeginProg and ends with EndProg. The measurements,
processing, and calls to output tables bracketed by the Scan and NextScan
instructions determine the sequence and timing of the datalogging.

BeginProg
Scan(1,MSEC,3,0)
PanelTemp(RefTemp,

250)

TCDiff(TC(),6,mV50,4,1,TypeT,RefTemp,RevDiff,Del,Integ,Mult,Offset)
CallTable

Temp

NextScan
EndProg

9-26

Advertising