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

44
BASIC COMMANDS & FUNCTIONS
Used in conjunction with the GETDB command, SITEID requests the System 5000™’s Site ID
as specified in the System Settings screen and stores it in the given string variable.
Used in conjunction with the SETDB command, SITEID sets the System 5000™’s Site ID to the
given value.
GETDB SITEID, var$ REM stores the current Site ID in the var$ variable
SETDB SITEID, “Site_120” REM sets the Site ID to “Site_120”
SITEID
Causes the program to pause execution for the specified number of seconds. A decimal number
may be used to specify more specific and smaller time increments (e.g. milliseconds). SLEEP
and DELAY are identical commands.
SLEEP 2.5
REM pauses the program for 2.5 seconds
DELAY 0.25 REM pauses the program for 0.25 seconds
SLEEP
An optional parameter in SETVALUE and GETVALUE commands to specify the use of an option
card. If not specified, SLOT0 is presumed (the daughterboard). May also be substituted with the
string representation of “SLOTX”.
GETVALUE ANALOG3 SLOT2, s$ REM stores a new Analog Channel 3 measurement
REM from Slot 2 in the s$ string variable
SETVALUE COUNTER1 “SLOT3”, 25 REM sets the Counter on Digital Port 1 on
REM
Slot
3
to
25
SLOTX
Splits apart a string into an array of strings. The first parameter provides the string to split apart.
The second parameter provides the array which the new substrings will fill. The optional third
parameter provides the delimiters or characters that determine where to split the primary string.
If more than one delimiter is specified, splitting will occur at each character given (e.g. if a
comma and hyphen are given “,-”, content will be split on any commas or hyphens found as in
the example below). If no delimiter is specified, whitespace will be used as the delimiter (e.g.
spaces and tabs).
Empty elements in the array are created if two delimiters are next to each other (see element 5
below, regarding the sequence “Analog2,-Analog4”). The TOKEN function, on the other
hand, does not add empty elements if two or more delimiters are in sequence.
SPLIT (string, array, string)
Returns the sine value of the given number.
var = SIN(PI/2)
REM stores 1 in the var variable
PRINT SIN(0) REM prints “0”
SIN ( )