4 measurement and output processing instructions, 5 line continuation – Campbell Scientific RTDAQ Software User Manual

Page 82

Advertising
background image

Section 5. Program Creation and Editing

As an example of Measurement Processing, to convert a thermocouple
measurement from degrees Celsius to degrees Fahrenheit, you could use the
following expression:

TCTempF=TCTemp(1)*1.8+32

Logical Evaluation expressions could be used to determine the flow of a
program:

If TCTemp(1) > 100 Then
Call Subroutine1
Else
'enter code for main program

End If


Many parameters will allow the entry of expressions. In the following
example, the DataTable will be triggered, and therefore data stored, if
TCTemp(1)>100.

DataTable(TempTable, TCTemp(1)>100, 5000)

5.1.4.4 Measurement and Output Processing Instructions

Measurement instructions are procedures that set up the measurement
hardware to make a measurement and place the results in a variable or a
variable array. Output processing instructions are procedures that store the
results of measurements or calculated values. Output processing includes
averaging, saving maximum or minimum, standard deviation, FFT, etc.

The instructions for making measurements and outputting data are not found in
a standard basic language. The instructions Campbell Scientific has created
for these operations are in the form of procedures. The procedure has a
keyword name and a series of parameters that contain the information needed
to complete the procedure. For example, the instruction for measuring the
temperature of the CR5000 input panel is:

PanelTemp (Dest, Integ)

PanelTemp is the keyword name of the instruction. The two parameters
associated with PanelTemp are: Destination, the name of the variable in which
to put the temperature; and Integration, the length of time to integrate the
measurement. To place the panel temperature in the variable RefTemp (using
a 250 microsecond measurement integration time) the code is:

PanelTemp(RefTemp, 250)

5.1.4.5 Line Continuation

Line continuation allows an instruction or logical line to span one or more
physical lines. This allows you to break up long lines of code into more
readable “chunks”. Line continuation is indicated by one white space character
that immediately precedes a single underscore character as the last character of
a line of text. Following is an example of line continuation:

5-22

Advertising