beautypg.com

Commands and functions – Xylem STORM 3 Basic Programming manual User Manual

Page 24

background image

Returns the temperature, in degrees Celsius, of the given number (expecting a 0-5V analog voltage

reading) based on the math equation for the WaterLog model H-377 temperature probe.


var = H377C(3.25) REM sets var to 23.1779

22

COMMANDS AND FUNCTIONS

H377C (number)

Returns the temperature, in degrees Fahrenheit, of the given number (expecting a 0-5V analog

voltage reading) based on the math equation for the WaterLog model H-377 temperature probe.

var = H377F(3.25) REM sets var to 73.7203

H377F (number)

Returns the hexadecimal string representation of the given number.

var$ = HEX$(32) REM sets var$ to 20

HEX$ (number)

Used to take actions based on the evaluation of given conditional statements. True is determined

as anything non-zero; false is zero.

The short form of the IF statement does not include a THEN and must remain on one line. Multi-

line IF statements contain the THEN keyword as well as ENDIF to mark the ending of the IF

statement. IF statements may also contain the keywords ELSEIF to introduce alternative conditional

statements as well as the ELSE keyword to provide a default path if no other conditions evaluate to

true.

Single-line IF statement:

var = 250

IF (var > 200) var = 200 REM sets var to 200

Multi-line IF statement:

var = 40

IF (var >60) THEN

var = 60

ELSEIF (var >30) THEN

var = 30 REM sets var to 30

ELSE

var = 0

ENDIF

IF