beautypg.com

9 instructions, 1 measurement and data storage processing, Crbasic example 12. measurement instruction syntax – Campbell Scientific CR200/CR200X-series Dataloggers User Manual

Page 96

background image

Section 9. Programming

Scan () determines how frequently instructions in the program are executed.

Scan has two parameters:

Interval is the interval between scans.

Units is the time unit for the interval. Interval is 1sec <= Interval <= 1 day.

CRBASIC EXAMPLE 11.

BeginProg / Scan / NextScan / EndProg Syntax

BeginProg

Scan (1,Sec)

Therm109 (TempC(),2,1,Ex1,1.0,0)

CallTable Temp

NextScan

EndProg

9.9 Instructions

In addition to BASIC syntax, additional instructions are included in CRBASIC

to facilitate measurements and store data.

CRBASIC Programming Instructions

(p. 93) contains a comprehensive list of these instructions.

9.9.1 Measurement and Data Storage Processing

CRBASIC instructions have been created for making measurements and storing

data. Measurement instructions set up CR200(X) hardware to make

measurements and store results in variables. Data storage instructions process

measurements into averages, maxima, minima, standard deviation, FFT, etc.

Each instruction is a keyword followed by a series of informational parameters

needed to complete the procedure. For example, the instruction used to set an

excitation channel to a specified value is:

ExciteV (ExChan,ExmV)

"ExciteV" is the keyword. Two parameters follow: ExChan, the excitation

channel number to which the voltage should be applied; and ExmV, is the

excitation, in millivolts, to apply to the sensor. The syntax for applying 5000

millivolts to a sensor through excitation channel number 1 is shown in

CRBASIC EXAMPLE. Measurement Instruction Syntax

(p. 84).

CRBASIC EXAMPLE 12.

Measurement Instruction Syntax

ExciteV (1,mV5000))

84