beautypg.com

Basic programming – Xylem STORM 3 Basic Programming manual User Manual

Page 6

background image

Understanding the available functions and commands as well as the overall operations and flow

of Basic is essential to its use within the Storm. Primary Basic concepts and examples are provided

below, followed by a listing of all available commands and functions. Each command is given a

description and an example of its use. Additional examples are included at the end of this manual.

Before a Basic program can be used, it must first be installed on the Storm. This is done through

the Sensors > Basic Programming screen. Basic programs should have a “.bas” extension to

identify them as Basic programs. There is no limit to the number of programs that can be installed

or used on the Storm

Basic Fundamentals

BASIC PROGRAMMING

Basic programs on the Storm can be set up to run on a timed schedule. A Basic program is set

up similar to any other sensor through the Sensor > Add New Sensor screen. Selecting “Basic

Program” from the available list will create the structure necessary to schedule a Basic program.

When a program is selected, the program’s internal variables are displayed as selectable items.

Each variable’s value can be captured and used after a program has run. These values can be

used with one or more outputs, such as logging to a file, sending to GOES, or sending to Storm

Central. Basic programs are evaluated according to their ordering within the sensor list, set by

each sensor’s Scan Order. Basic programs should be placed last in the Scan Order if the programs

use values from other sensors measuring at the same scan time, in order to retrieve the latest

measurement values.

Scheduling a Program

Basic programs can also be used to respond to “listen” and respond to communication on the

RS-232 Com port. Programs can be used to respond to specific commands, make measurements,

send data, etc. Using a listening program, data loggers or other serial devices (e.g. a PC or server)

can communicate and send data back and forth. Listening programs are assigned under the

Outputs > Communication Ports Setup screen in the Storm. Examples of listening programs can

be found under the OPEN command.

Listening Programs

4

Basic programs are parsed before execution and validatedthroughout. If any syntax errors are

found in the code, the Basic program will abort and the Storm will continue its operations.

To assist with troubleshooting, the Sensors >Basic Programmingscreen contains a Debug section

that allows line by line execution of an installed Basic program with detailed reporting of variables

information and other related output. Any errors that are reported should be resolved before

implementing the program into the Storm’s schedule.

Error Handling