Basic commands & functions – Xylem System 5000 BASIC Manual User Manual
Page 16

14
A parameter to the DATETIME function returning a string representation of the most recent
triggered alarm time, formatted as “HH:MM:SS”.
var$ = DATETIME(ALARM$) REM stores the most recent alarm e.g. “05:00:00”
ALARMS
Used in conjunction with the GETVALUE command, ANALOGX requests a new measurement
to be made on the specified Analog channel and stores the value in the given variable.
slot$ = “SLOT2”
GETVALUE ANALOG1, var REM stores a new Analog Channel 1 measurement
REM from the daughterboard in the var variable
GETVALUE ANALOG3 slot$, s$
REM stores a new Channel 3 measurement
REM from Slot 2 in the s$ string variable
ANALOGX
A logical operator used between two expressions in conditional statements (e.g. if, while, etc).
Returns TRUE if the left and right expressions are TRUE, otherwise FALSE is returned.
var = 100
IF (var > 0 AND var < 50) PRINT “Small”
REM prints nothing
IF (var > 0 AND var < 150) PRINT “Large” REM prints “Large”
AND
BASIC COMMANDS & FUNCTIONS
Declares and creates an array. Arrays may be single or multi-dimensional and filled with
numbers or strings. Number arrays, when created, are filled with zeros, while string arrays are
filled with empty strings (“”). To enlarge an arrays size (not its dimension), re-declare the array
with a larger size. Existing data will be preserved. Re-declaring an array with a smaller size
does nothing. ARRAYDIM and ARRAYSIZE can be used to determine the number of
dimensions of an array as well as the sizes of those respective dimensions.
Single-dimensional array:
ARRAY myArray(5)
FOR i = 1 TO 5
myArray(i) = i * 2 REM Duplicate the number’s value inside the array
NEXT i
REM myArray(i) now contains values 2 4 6 8 and 10
ARRAY