beautypg.com

Xl™ series – Xylem XL-BASIC Programming Guide User Manual

Page 21

background image

XL™ SERIES

XL-BASIC Programming Guide 23-21

REM ASSIGN BATTERY VOLTAGE TO BASIC1 VARIABLE FOR LOGGING
BASIC1 = BATT

REM CLOSE COM PORT 3
CLOSECOM3
END

Example Program #2

Post Purge Every Scan:

It may be desirable to purge more often than once a day as provided by options in the menu
interface. The following example shows how to purge from once every scan to once every ‘n’
scans, where ‘n’ is set by the user as needed. Make sure this basic program is the last item in the
report list. In this case the purge happens at the end of the scan. This is because the purge will
create a lot of noise on the orifice line and this gives the most amount of time from the purge to
the next measurement for the noise to dissipate.

REM Program to purge every 4

scan

th

REM this value sets the number of scans to make before a purge should be done.
REM In this example a purge will be done every 4 scans.
REM If scanning every 15 minutes, then a purge every hour will be done

if a > 4 then a = 4

REM make sure counter is in range

if a < 0 then a = 4

a = a - 1

REM decrement the counter

if a == 0 then goto 100 REM if zero then purge
basic1 = 0;

REM default status flag to No Purge

end

100
purge

REM start purge

basic1 = 1

REM set status flag to indicate purging

a = 4
end