Rockwell-automation 2708-NBD VBASIC Language Development Kit Instrukcja Użytkownika Strona 39

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 84
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 38
Chapter 5
A-B VBASIC Application Library
52
Installation consists of installing the diskette in drive A: and typing:
A:
INSTALIB d:
Where d is the destination drive.
You must first set up Visual BASIC, see Microsoft manual Learning to Use
Microsoft Visual BASIC for installation procedures (manual is provided
with the software). Also, make sure that the commands VB and LXBC are
available from the installed directory \ LIB.
The A-B VBASIC compiler requires that all of your program reside in a
single file. (It does not support a LINK step which would combine multiple
independent object files into a single run file.) Since the BASIC Language
Development Kit is made up of multiple files, the normal way to use it is to
append all of the desired modules together and then load the resultant file
under Visual BASIC or compile it with the A-B VBASIC Compiler.
The only required module of the library when testing on the PC is
ENVPC.BAS.
Suppose you have the following program:
DEFINT AZ Recommend default variable type
OpenLINX REQUIRED library initialization
TIMEOUT% = 1000 Set a 10 second timeout
DO
CLD
PRINT Library Test
PRINT Do something ; 2nd line MUST have; or scrolls
e = ReadEvent% (2) The mask (the 2) means read
SELECT CASE e from keyboard/bdg with timeout.
CASE TimeoutEvent The 10 seconds expired so make
CLS: PRINT *Timeout* ”’ this obvious.
BEEP : SLEEP 2
CASE BadgeEvent : CLS The event that occurred was a
PRINT Badge read”’ Bar code badge.
PRINT InBuf$; The badge contents is in InBuf$
BEEP : SLEEP 2 Make some noise, and show badge.
CASE ELSE : CLS Case Else required in LinxBASIC!!
PRINT Key = ;e; Display ASCII code for the key
SLEEP 2 or negative code if its special.
END SELECT
LOOP Do this test forever
Using the Library
Przeglądanie stron 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 83 84

Komentarze do niniejszej Instrukcji

Brak uwag