beautypg.com

Xylem System 5000 BASIC Manual User Manual

Page 29

background image

27

Basic Commands and Functions

Returns the provided Task’s most recent measured value. If an unknown Task is specified,

the System 5000™ Default Error String (default is -99.99) is returned. If previous a Task/scan

measurement is desired, an additional parameter may be specified prior to the last variable. A “1”

indicates the most recent scan, “2” indicates the previous scan, “3” indicates three scans prior, etc.

GETTASK “myTask”, var

PRINT var

REM prints “0.023”, as myTask currently measures Analog 1

REM Average the last four scans

task$ = “myTask”

FOR i = 1 to 4

GETTASK task$ i, tempVal

avg = avg + tempVal

NEXT i

avg = avg/4

PRINT “myTask avg: “, avg REM prints the average of the last four scans

GETTASK

Returns the provided Task’s most recent measured value timestamp formatted according to the

system setup (default is MM/DD/YYYY HH:MM:SS). If an unknown Task is specified, the System

5000™ Default Error String (default is -99.99) is returned. If previous a Task/scan measurement

timestamp is desired, an additional parameter may be specified prior to the last variable. A “1”

indicates the most recent scan timestamp, “2” indicates the previous scan timestamp, “3” indicates

three scans prior timestamp, etc.

GETTASK “myTask”, var

GETTIMESTAMP “myTask”, var_time$

PRINT var_time$, “ “, var

REM prints the timestamp and value of myTask

GETTIMESTAMP

Used to request a new measurement from the System 5000™. Available parameters are ACIN

(AC-In), ANALOGX (Analog), DIFFXX (Differential), BATT (Battery), DIGITALX (Digital Port Level),

FREQUENCYX (Frequency), COUNTERX (Event Counter), QUADXX (Quadrature Counter), SDIXX

or SDIXXX, TEMP (Internal Temperature), and 420MA (4-20mA Output). For analog and digital

measurements, X is a number indicating the requested port or channel. An optional SLOTX may

be specified for option cards (if not, the daughterboard is presumed). For SDI measurements, the

first X is the sensor address, the remaining X or XX is the requested parameter number. An optional

string may follow the SDI request specifying a measurement type, which if not specified, defaults

to “M”. Note that SDI-12 performs caching on measurement commands. Thus if a measurement

has already been requested for that time period, the previous values will be returned (rather than

requesting a new measurement). To force a new measurement, use the CLEARSDI( ) function to

clear the SDI cache. Lastly, a variable (either string or number) must be specified to store the

result. If an error is encountered the System 5000™ Default Error String (default is -99.99)

is returned.

GETVALUE