Basic commands & functions – Xylem System 5000 BASIC Manual User Manual
Page 48
46
BASIC COMMANDS & FUNCTIONS
Declares a user-defined subroutine. Subroutines can specify and accept multiple arguments and
can return a number or string value using the RETURN statement. The END SUB statement
marks the end of a subroutine. For consistency, it is recommended that any subroutine returning
a string should have the subroutine’s name end with a dollar-sign (“$”).
Specific SUB commands may also be used as special entry points for designated IO. These SUB
commands are case-sensitive and only called if two conditions are met: 1) The special SUB
command is declared properly, and 2) the designated IO or Network option calls the program.
This allows only desired segments of code to be run based on the calling process. For instance, if
a single program contained both the SUB Input() and SUB Network() routines, only the Input
subroutine would be run when the program is called from a Task Input, and only the Network
subroutine would be called when a connection is made on a Listening Port. If an Output from a
Task called the program, the program would run the program, like normal, from the beginning
(as no entry point/SUB Output() command was found). Once the subroutine ends, the basic
program is ended as well and no other portions of the code would be run. The case-sensitive
subroutines of SUB Input(), SUB Output(), SUB Serial(), and SUB Network() are available for
use, though not required for standard program execution.
REM Calculate the Volume of a Rectangle
heighth = 3
width = 4
depth = 5
volume = calc_volume(heighth, width, depth)
PRINT “Volume: “, volume REM prints “Volume: 60”
SUB calc_volume(h, w, d)
vol = h * w * d
RETURN vol
END SUB
SUB Output()
REM This subroutine only will run if called from a Task Output
PRINT heighth REM prints 0 as heighth was not declared in this routine
END SUB
SUB
Used in conjunction with the GETPOWER command, SW12V requests the current state of the
Switched +12 Volt and stores the value in the given variable. A 1 is stored if On, 0 if Off.
Used in conjunction with the SETPOWER command, SW12V specifies the Switched +12 Volt
to be turned on or off. Numbers greater than zero will turn the Switched +12 Volt On, and
SW12V
- H-2191
- H-223
- H-264
- H-310
- H-312
- H-3301
- H-3342
- H-335
- H-339
- H-340-CalKit
- H-340
- H-340SDI
- H-3521
- H-3531 FlashLite
- H-3551
- H-3553
- H-375 04101 WIND MONITOR-JR
- H-4161
- H-4191
- H-424MS V1.0
- H-424MS V1.1
- H-4271
- H-4280
- H-4400
- H-4401
- H-5223
- STORM 3 UPGRADE
- System 5000 User Manual
- DH-21
- BrazedPlate Heat Exchangers
- Heat Exchangers
- GL500 MULTICHANNEL DATA LOGGER
- 4046 ANALOG TO SDI-12 CONVERTER
- 4015 SDI-12 TO ANALOG CONVERTER
- iRIS-CAM Wastewater Security Camera
- SDI-12 Data Logger iRIS 220, iRIS 320, iRIS 350, iRIS 150, iRIS 300
- iRIS 150 GPRS DATALOGGERS
- iCE3 GPRS Variant
- GL500-2-1 Data Logger
- 3101 CONDUCTIVITY CONTROLLER
- 3675 pH CONTROLLER
- 378 TEMPERATURE CONTROLLER
- Expert 1400
- Expert 700
- Expert 7060_7070_Modbus
- Palmer & Bowlus flumes
- Parshall flumes
- Flow Converter 713
- MagFlux IP 68 Protection
- Magflux Electromagnetic Flow Meter
- MagFlux Day flow logger function
- Oxix Calibration
- Oxix Dissolved Oxygen Transmitter
- SuSix Sensor with Wiper - Wiper and Gasket Replacement Kit 206355
- SuSix Sensor with Wiper - Wiper and Gasket Replacement Kit 206356
- SuSix Turbidity and Suspended Solids Transmitter
- PHIX COMPACT pH and Redox Transmitter
- 701 PUMP CONTROLLER
- 712 PUMP CONTROLLER
- 704 PUMP CONTROLLER
- MY CONNECT Quick Guide
- MY CONNECT HMI display
- CONNECT Quick Guide
- CHATTER Base System install guide
- CHATTER Notification System configuration guide
- CHATTER Notification System install guide
- CHATTER RTU and E-mail
- CHATTER Base System Setup Tool Users Guide
- CHATTER Hardware Manual
- 531-532-533 DIGITAL INDICATORS
- 780 LIQUID SAMPLER
- 205546 Modbus Communication Modules for Displays
- 205547 Profibus Communication Modules
- 703 PUMP CONTROLLER
- Expert 800-900
- 702 MJK Comtroller
- 795 MJK Data Transmitter
- 795 II MJK Data Transmitter - GSM Modem
- SDI-12 RADAR
- STORM Central
- STORM 3 Basic Programming manual
- STORM 3 Getting Started Guide
- System 5000 Getting Started Guide
- XL-BASIC Programming Guide
- XL Series H-350XL
- CXA000 12 SWING SAMPLERS
- SP250 QUICK RELEASE WATER SAMPLER
- WS700 COMPOSITE/DISCRETE WATER SAMPLER
- WS700R REFRIGERATED WASTEWATER SAMPLER
- WS755 IMPROVED WASTEWATER/STORMWATER SAMPLER
- WS705 IMPROVED COMPOSITE/DISCRETE WATER SAMPLER
- WS750 WASTEWATER/STORMWATER SAMPLER
- RG600 TIPPING BUCKET RAIN GAUGE, 8 INCH
- RG700 4-20 mA Output Module
- RG200 RAIN GAUGE, 6 inch (TIPPING BUCKET)
- WE Sensor
- SP101 Solar Panel
- WE800 Weather Station
- SIT65 SATELLITE INTERNET TELEMETRY
- WIND ALARM CONTROLLER
- Expert MJK 1100-2100-3100
- 501 Electrode Control
- MJK 713 Open Channel Flowmeter