Rockwell Automation 2708-NBD VBASIC Language Development Kit User Manual

Page 30

Advertising
background image

Chapter 4

Special Devices in A-B VBASIC

4–9

CLOSE “HOST”

Note: When HOST is CLOSEd, the A-B VBASIC interpreter always tells
the network task that no data is available from the QUE, even if data is really
present. There may be records remaining in the QUE. If so, they will not be
available to the network until HOST is once again made OPEN. If necessary,
use the LOF function to determine when the QUE is empty, before
CLOSEing HOST.

WRITE #

If the presence of commas and quotation marks is acceptable to your host,
this is the simplest way to send a record. Don’t forget to precede the WRITE
with a call to FRE to make sure memory is available. As with all output to
the network, the interpreter adds the required record delimiters.

PUT to HOST

PUT is an excellent way to output a variable which has been defined in a
TYPE statement. Just remember that all the elements in the TYPE must be
fixed length strings. Numerics are not allowed (as binary quantities) since
adherence to the “printable character” restriction is not assured.

The data is put into the queue for automatic transmission to the host
computer, in order, when possible.

PUT to NET

If the (network) output buffer is empty (see LOF), the record provided will
be the next one taken by the network for transmission to the host.

Note: If the output buffer is in use, execution of this statement suspends the
A-B VBASIC program until the previous record is taken. So, unless your
program is prepared to wait, do not use this statement without first checking
LOF on the NET device. Better yet, PUT to HOST.

PUT to QUE

This statement acts like PUT to HOST. Generally, it is used to create a
“batch” of records for the host which will be released at some future time by
an OPEN “HOST”. Important distinction: PRINT, and WRITE to the QUE
add a record delimiter in the same way as output to HOST. Outputs to regular
RAM files do not perform this insertion.

PRINT #

All PRINT #s to HOST, NET, and QUE are restricted. After every PRINT,
the interpreter inserts the carriage return, line feed record delimiter. It is not
possible to use multiple PRINTs to make one record.

Details of Specific Statements
and Functions (cont’d)

Advertising