Checkreturn ( ), Close, Chr$ (number) – Xylem System 5000 BASIC Manual User Manual

Page 19: Clearsdi ( )

Advertising
background image

17

Basic Commands and Functions

Returns the result (return value) of the most recent PRINT to either a serial or ethernet

connection. If an error has occurred, this number will be less than zero. A successful PRINT

returns the number of characters written to the open connection. This may be most useful for

detecting disconnected serial or network ports.

OPEN

PRINT CEIL(4.7)

REM prints “5”

CHECKRETURN ( )

Closes a file, serial/com port, or network/ethernet connection that has been previously opened

with the OPEN command.

OPEN “COM2” AS #9

CLOSE #9

OPEN “SiteID.csv” FOR APPENDING AS #1

CLOSE #1

OPEN “192.168.0.1:80” AS #4

CLOSE #4

CLOSE

Returns the number’s ASCII character representation. ASC( ), converting a character to its ASCII

numerical value, is the opposite function of CHR$( ).

PRINT CHR$(65)

REM prints “A”

PRINT ASC(“A”)

REM prints “65”

CHR$ (number)

Clears the current time period’s SDI-12 cache. Using prior to a GETVALUE SDIXX command

forces the GETVALUE command to retrieve new SDI-12 measurements.

CLEARSDI() REM Clear any cached SDI values for this time period

GETVALUE SDI01, a1$

REM request a new measurement (address 0, param 1)

GETVALUE SDI02, a2$

REM retrieve the second parameter

CLEARSDI() REM Force our next request to be a new measurement

GETVALUE SDI01, b1$

REM request a new measurement (address 0, param 1)

CLEARSDI ( )

Advertising