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

12
BASIC COMMANDS & FUNCTIONS
Basic 5000 uses a combination of commands and functions to allow more complex operations to
be performed on the System 5000™. Commands and functions can both return values, though
each is done in a different manner. Commands such as INPUT and GETTASK return values to
the variable specified last on the line, after a comma:
GETTASK “Batt”, a$ REM stores the value of the Batt Task in variable a$
Functions, on the other hand, list the variable first, using an equals operator (“=”) to retrieve the
calculated value:
a = DATETIME(TIME) REM stores the current time (HHMMSS) in variable a
Commands and Functions available to the Basic 5000 language are listed alphabetically below.
Used in conjunction with the GETVALUE command, 420MA retrieves the current setting of the
4-20mA current loop and stores the value in the given variable.
Used in conjunction with the SETVALUE command, 420MA specifies the 4-20mA current loop
to be set to the desired number.
Example:
GETVALUE 420MA, var
REM stores the current 4-20mA setting from the
REM
daughterboard
in
the
var
variable
slot$ = “SLOT2”
GETVALUE 420MA slot$, s$
REM stores the current 4-20mA setting from
REM Slot 2 in the s$ variable
SETVALUE 420MA, 12.5
REM sets the 4-20mA on the daughterboard to 12.5mA
a = 16.0
SETVALUE 420MA SLOT1, a+2
REM sets the 4-20mA on Slot 1 to 18mA (a+2)
420MA
Used in conjunction with the GETPOWER command, 5VREF requests the current state of the
+5V Reference and stores the value in the given variable. A 1 is stored if On, 0 if Off.
Used in conjunction with the SETPOWER command, 5VREF specifies the +5 Volt Reference to
be turned on or off. Numbers greater than zero will turn the +5 Volt Reference On, and numbers
less than or equal to zero will turn the +5 Volt Reference Off.
GETPOWER 5VREF, var
REM stores a 1 if On, 0 if Off for the 5V Reference
REM on the daughterboard in the var variable
GETPOWER 5VREF SLOT1, s$
REM stores a 1 if On, 0 if Off for the 5V Ref.
REM on the Slot 1 5V Ref in the s$ variable
SETPOWER 5VREF, 1
REM turns the +5V Reference on the daughterboard On
slot$ = “SLOT1”
a = 0
SETPOWER 5VREF slot$, a REM turns the +5V Reference on Slot 1 Off
5VREF