beautypg.com

The a-b vbasic development procedure (cont’d) – Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual

Page 88

background image

an A-B VBASIC Program

Chapter 10

Developing and Running

10–2

In order to emulate programs on a PC the A-B Application Library was
developed (see Chapter 13). Many basic I/O routines for the various devices
found on a workstation are available through this library. These include
inputs from barcode scanners, timeouts, formatted and edited keypad read
routines, data conversion routine, etc. One of the clear benefits of using the
library is that you don’t have to “re-invent the wheel”.

There are two main files in the Application Library: ENV.BAS and
ENVPC.BAS. When testing your program on a PC, just include
ENVPC.BAS into your program, and all your I/O will be directed at standard
PC devices which will emulate the workstation. When it’s time to run the
program on the real workstation, simply substitute ENV.BAS at compile
time.

Step #5 – Compiling the A-B VBASIC Program

After the program has been written and tested on the PC using ENVPC or
Application Generator Software, the program must be converted into a form
that a workstation can understand. This is done with the A-B VBASIC cross
compiler (LXB). LXB will flag any lines that do not fit the subset of allowed
commands. It will also flag syntactical errors, but those will normally already
have been taken care of by the Visual BASIC editor. The output of the LXB
compiler is a “.LXE” file, suitable for downloading to a workstation.

Step #6 – Downloading

You can download the program with another software product called
Network Manager Software (Catalog No. 2708-NNM). Network Manager
Software is a data collection and network management program which can
collect data, download programs and files, and perform network management
functions. It is the preferred tool for commmunicating between a PC and a
workstation network. It interprets network status records and provides
repetitive command transmissions to multiple workstations. However, in the
absence of Network Manager Software, any asynchronous terminal emulator
that has a file transfer feature and honors XON/XOFF protocol should work.

As soon as the download is complete, the program automatically starts
running. At this point the program can be tested for proper functioning on the
workstation itself.

To summarize, the steps in developing an application for a workstation are as
follows:

1. Lay out a structured design for application
2. Decide if application is small or large (is CHAINing necessary?)
3. Use developed tools wherever possible

(BASIC Language Development Kit)

4. Code the application using the Visual BASIC editor or Application

Generator Software

5. Test the program under simulation (include ENVPC.BAS)
6. Compile with LXB (include ENV.BAS)
7. Download the program
8. Test the program on the target workstation

The A-B VBASIC
Development Procedure
(cont’d)

This manual is related to the following products: