3 - the a-b vbasic cross-compiler (lxb), Overview, The a-b vbasic cross-compiler (lxb) – Rockwell Automation 2708-NBD VBASIC Language Development Kit User Manual

Page 18

Advertising
background image

A–B

3

Chapter

3–1

The A-B VBASIC
CROSS-COMPILER (LXB)

The Visual BASIC Development Environment alone will not generate a
program for a workstation. Visual BASIC allows the developer to create a
program which can execute on a PC, but it is unable to create programs that a
2708-DH5 workstation can understand. To do that, we have developed a
cross compiler that accepts an ASCII text file containing valid BASIC
statements and creates a file that will execute only on a 2708-DH5
workstation. The extension .LXE is an adaptation of the .EXE name
commonly used for executables under MS-DOS.

Typically a program is created and tested on a PC compatible computer with
Visual BASIC and the application library. Once the program is refined
through editing and testing, it can be compiled into an LXE file. The LXE
file is also an ASCII text file. However, because it contains pseudo-code it
doesn’t look like anything familiar. Even character strings will not be visible
in the file. The LXE can therefore be considered an encrypted file.

Because it is pure ASCII displayable text, it can be uploaded to other
computers without worrying about control codes or binary objects becoming
garbled. There should be no problem, for example, uploading an LXE file to
an IBM mainframe, which can later download the program to a 2708-DH5
network using its native EBCDIC/ASCII translation tables.

Each line of an LXE file begins with a two-character sequence called a
Network Directive. These are discussed in detail in the Attended Workstation
User’s Manual. For downloadable files, the two characters are a greater than
(>) and a comma (,). When the operating system sees an incoming record
prefaced with these two characters, it knows that this is a line from a
compiled program and not a line of data. If the file is in PGM format (see
next section), it will have an additional network directive appended to the
front of each record, and a 2-record header on the file.

The next two characters will begin with AA and increment sequentially
through ZZ.

Any further discussion of the contents of the LXE records is beyond the
scope of this document. Since the LXB compiler puts out an entire file, no
further information is needed.

Following a successful download, the workstation will begin immediately
executing the program.

Overview

Advertising