beautypg.com

Tan (number), Tell (filenumber) then – Xylem STORM 3 Basic Programming manual User Manual

Page 39

background image

37

Commands and Functions

Used with the IF statement to specify a multi-line IF-THEN clause.

var = 40

IF (var >60) THEN

var = 60

ELSEIF (var >30) THEN

var = 30 REM sets var to 30

ELSE

var = 0

ENDIF

Returns the tangent value of the given number.

var = TAN(PI/4)

REM sets var to 1

var = TAN(0)

REM sets var to 0

TAN (number)

Returns the current read position of the given file number.

REM Presuming SiteID.csv contains:

REM Digital1,Analog2,WindSpeed

REM 56.23,2.25,126.5


OPEN “SiteID.csv” FOR READING AS #1

INPUT #1, var$

REM sets var$ to Digital1,Analog2,WindSpeed

var = TELL(#1)

REM sets var to 27

SEEK #1, -6, “CURRENT”

var = TELL(#1)

REM sets var to 21

INPUT #1, var$

REM sets var$ to Speed

CLOSE #1

TELL (filenumber)

THEN

Used with the FOR statement to specify the range of the loop.

FOR x = 1 TO 3

REM retrieve the past 3 values of the Sensor named “Analog”

GETVALUE SENSOR “Analog” x, var$

NEXT x

TO