beautypg.com

Device: the #9 user status display – Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual

Page 111

background image

Chapter 12

Special Devices in A-B VBASIC

12–15

The LED in the lower left corner of alphanumeric keyboards is used as a
shift lock indicator by the operating system. A-B VBASIC programs should
not change it.

The BASIC Language Development Kit contains a subroutine SetLED which
can be called to turn LEDs on and off. Or use this code example:

CONST LiteDev = 1
On$ = “1”: off$ = “0”

‘ Cannot be a CONSTant

OPEN “LITE” FOR RANDOM AS #LiteDev
FOR X = 1 TO 10

‘ Do 10 LEDs

PUT #LiteDev, X, On$

‘ Turn LED on.

SLEEP .25
PUT #LiteDev, X, Off$

‘ Turn LED off

SLEEP .25

NEXT X
CLOSE LiteDev

Reserved device name: STAT

Description:

The front panel status displays shows information about the condition of a
workstation. The number 9 status display is dedicated to showing status
information from the application.

Two lines are available with 40 characters each. A summary status character
which appears over the 9 on the zero summary status display, is also
available.

The PUT statement is used to place information in the buffer which is shown
when the #9 display is selected.

PUT to record number 1 places the string on the top line of the display. Put to
record number 2 places the string on the second line of the display. PUT to
record 3 places the first character of the string over the 9 on the summary
display.

OPEN “STAT” FOR RANDOM AS #3
LTOP$ = “Data Corp Inventory”
LBOTTOMS$ = “Duncan Street Warehouse”
SC$ – “ . ”
PUT #3, 1, LTOP$
PUT #3, 2, LBOTTOM$
PUT #3, 3, SC$

If your application must shut down or cannot start up, for example due to a
missing file that the host was supposed to download, put an error on the
status display before program termination.

Remember that these statements do not cause the status display to appear,
they only define the display’s contents when invoked by the operator.

Device: Front Panel LED’s
(cont’d)

Device: The #9
User Status Display

This manual is related to the following products: