Rockwell Automation 2708-DH5B2L_DH5B4L Attended Workstation User Manual
Page 107
Chapter 12
Special Devices in A-B VBASIC
12–11
IOCTL$ (intrinsic function) for HOST and NET
This function returns a string formatted as follows:
Byte 0:
‘0’ when the workstation is offline to the network.
‘1’ when the workstation is online.
Bytes 1-4: is the workstation’s number (without a minus).
Bytes 5-9: is the workstation type (its network role) as
NORML
CONCN
MASTR
SUBM
ALTM
ALTSM
IOCTL (statement) for HOST
Characters 9 and 10 of all records arriving at the host contain a 2 digit
number (“Transaction Code”). Numbers 00, 98, and 99 are reserved. A-B
VBASIC programs can change these two digits for records from HOST, from
the default of 01.
For example, if the statement IOCTL #5, “29” is used where #5 is associated
with HOST, digits 9 and 10 of records containing data from this workstation,
will be 29.
Note: Only numeric digits are valid. IOCTL is not valid in its statement form
for the NET device.
Reserved device names: COM and AUX
Opening a com port:
Access to the communications ports begins with the statement OPEN
“COM” and OPEN “AUX”. On a PC, Visual BASIC allows you to specify
baud rate and other parameters in the OPEN “COM” statement. In A-B
VBASIC these are NOT valid! Comm parameters are set using the Setup
Menus (see Chapter 5 for details). If you are using the ENV/ENVPC
collections of subroutines in the BASIC Language Development Kit (Catalog
No. 2708-NBD), a call to OpenLINX will automatically open all required
comm ports.
The primary communication port is dedicated to networking functions in all
terminal types except NORMAL. Any attempt to OPEN
’COM” on any workstation which has not been set to a workstation type of
NORMAL (using the Setup Menus) will result in a runtime error.
Units with a second (“AUX”) port may use that port via OPEN “AUX”
regardless of the workstation‘s network role.
OPENing a communications port has no effect on the state of the modem
control lines DTR and RTS. These are always under the control of the
BASIC program using IOCTL, or one of the BASIC Language Development
Kit subroutines discussed later.
Details of Specific Statements
and Functions (cont’d)
Devices: Communication
Ports, Primary and
Auxiliary