beautypg.com

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

Page 14

background image

23-14 XL-BASIC Programming Guide

XL™ SERIES

DIGITS(#)

Set the number of digits to display to the right of the decimal point. The
default value is 2, and the range is 0 to 6. This option is used by the
PRINT, PRINT2, PRINT3 commands, the DISPLAY command, and the
WRITESDI and PRINTSDI commands.

Example:

print 5.00000

(prints 5.00 (default set to 2))

digits(5)
print 5.00000

(prints 5.00000)

digits(0)
print 5.00000

(prints 5)

--- Built In Display / Keypad Commands —

DISPLAY

Basically the same as print except the output is to the local display. The
curser will be left at the end of the printed string. Also no carriage returns
or line feeds will be sent at the end of the string as they would clear the
display. If the display is not turned on before this command is used then
the display will be turned on automatically.

DISPCLEAR

Clear all text from the display and position the curser at the home position.
If the display is not turned on before this command is used then the display
will be turned on automatically. Using this command is an easy way to
turn on the display.

DISPCURSER(##)

Position the curser at position ## where ## is 00 to 19. This allows a
message to be displayed once and some portion of the screen updated as
needed without having to redisplay the whole screen.

Example:

dispclear
display “Battery Volts = “
for x = 1 to 1000
dispcurser(16)
display batt
next
dispoff
end

DISPOFF:

Turn off the display now. If this command is not used the display will turn
off automatically when the system has no more tasks to perform.

INKEY:

Wait for a key to be pressed on the built in key pad. If no key is pressed
within 30 seconds, a 0.00 is returned and program execution continues.