Siemens SIMATIC TIWAY 1 Operation & User’s Manual
Read Online
Read the Siemens SIMATIC TIWAY 1 Operation & User’s Manual online using the built-in PDF viewer.
Text of the manual
SIMATIC TIWAY 1
UNILINK Host Adapter
User Manual
Order Number: PPX:TIWAY–8121–2
Manual Assembly Number: 2587871–0045
Second Edition
UNILINK HOST ADAPTER
1–1
USER MANUAL
CHAPTER 1
THE UNILINK HOST ADAPTER
1.1
INTRODUCTION
The UNILINK Host Adapter, Figure 1–1 is a second generation host computer
interface product that allows a host computer to operate and control secondary
devices on a TIWAY I network. The UNILINK Host Adapter, also referred to as
the “adapter” in this manual, is a hardware and software extension of the
original TIWAY I Host Adapter.
Figure 1–1 UNILINK Host Adapter
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–2
USER MANUAL
1.2
FEATURES
The hardware is composed of the UNILINK Adapter, shown in Figure 1–1, with
a plug-in Personality Interface Module (PIM) PPX:500–6224. The PIM, shown
in Figure 1–2, contains the software that causes the UNILINK Adapter to
operate as the UNILINK Host Adapter.
Figure 1–2 Personality Interface Module (PIM)
Figure 1–3 illustrates the basic structure of the UNILINK Host Adapter. The
corresponding physical features are shown in Figure 1–4. It includes an
RS–232–C/RS–423–A compatible host port that supports the Non-Intelligent
Terminal Protocol (NITP) used by the original TIWAY I Host Adapter, or the
BDLC protocol, an advanced, byte-oriented subset of the HDLC protocol. Also,
there are two TIWAY I interface ports and an external I/O point block.
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–3
USER MANUAL
Host
Computer
RS–232–C/RS–423A
Host Interface
(Command Processor)
TIWAY I
Interface
External
Input Point
Output Point
TIWAY I
Network
Secondaries
UniLink
Host Adapter
Figure 1–3 UNILINK Host Adapter Block Diagram
Port
1
Port
2
Port
3
Port
4
AC
NEUT
AC
LINE
GND
1 2 3 4 5
I/O
Host Computer Port
Power Connections
TIWAY I Ports
External I/O Points
PPX:500–7111, Dual Local Line media ports shown here.
Figure 1–4 UNILINK Host Adapter Physical Features
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–4
USER MANUAL
The features of the UNILINK Host Adapter include:
The adapter is noise hardened for factory floor use.
There are internal diagnostics tests to check the internal operation
when powered-up or reset, and during normal operation. There is also a
selectable test mode that is set locally.
The adapter can be reset locally with an internal switch or remotely
with a host issued command.
The adapter supports secondary-to-secondary communications without
complex host software or additional hardware.
The adapter is backward compatible with TIWAY I Host Adapter
software and drivers.
The adapter includes an independent host communications port
capable of serial communications at 38.4K baud. This port operates
simultaneously with the network ports.
This host port provides an optional advanced host protocol for improved
throughput and data integrity. This protocol also allows up to 32
UNILINK Host Adapters to be multidropped (via a modem) from the
same host computer RS–232–C/RS–423–A port.
The adapter supports or provides the following TIWAY I features.
The adapter supports the TIWAY I redundant media feature, providing
fault tolerant communications in case of a media failure.
The adapter supports communication with multiple network secondary
devices concurrently for higher network throughput.
The adapter supports concurrent network request processing. The host
computer does not have to wait for a request to complete before issuing
another request when using the advanced host communication
protocol.
Commands are provided for background data collection. The adapter
can be configured to collect data for the host computer by storing the
most current data values in internal memory. Another command then
retrieves the data.
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–5
USER MANUAL
The adapter is configurable for a variety of applications needs and
includes multiple host computer support, allowing several host
computers to communicate with the secondary devices on the same
TIWAY I network.
The adapter provides transaction statistics collection to aid network
performance tuning.
1.3
TYPICAL NETWORK APPLICATIONS
Figure 1–5 illustrates a typical single host network managing a process control
application. The host computer application directs the secondary devices
through the UNILINK Host Adapter and the TIWAY I network. Commands are
provided for downloading or uploading data from the host computer to the
secondary devices and for checking the status of an individual device.
Host
Computer
UNILINK
TIWAY I
UniLink Host Adapter ( MHU)
RS–232–C/RS–423–A
Host Interface Cable
Figure 1–5 Single Host Network
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–6
USER MANUAL
The flexibility of the UNILINK Host Adapter also provides for multiple hosts as
illustrated in Figure 1–6. In addition to the process control application, your
main plant system can link to the same network to track work-in-progress,
adjust schedule loads for peak efficiency, and collect product cost data. With an
additional UNILINK Host Adapter, you can also add a personal computer
workstation to the network for statistical quality control or other uses.
Host
Computer
UNILINK
UniLink Host
Adapter (MHU)
Host
Computer
UNILINK
UniLink Host
Adapter (MHU)
Figure 1–6 Multiple Host Network
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–7
USER MANUAL
1.4
TIWAY I SYSTEM CHARACTERISTICS
TIWAY I is a bus structure Local Area Network (LAN) designed for industrial
environments. The TIWAY I network connects a series of Texas Instruments
Programmable Controllers (P/Cs) and other devices to one or more host
computers. With the network, you can obtain, modify or replace data stored in
any of the following Siemens products:
SIMATICTI520/SIMATICTI530/
SIMATICTI520C/SIMATICTI530C P/Cs
SIMATICTI560/SIMATICTI565 P/Cs
PM550/PM550C P/Cs
5TI, Series 102, 103 P/Cs
IT–111, IT–121, IT–121A, IT150, and IT–160 Intelligent Tank
Transmitters (ITTs)
The P/Cs are connected to a TIWAY I network through Network Interface
Modules (NIMs). The PM550 P/C can also be connected with a Computer
Interface Module (CIM), but it limits the configuration choices. The UNILINK
Secondary Adapter is a TIWAY I interface device that allows other devices, such
as the following, to be connected to a TIWAY I network.
Robots
Computer numerical controlled machines
Non-SIMATIC programmable controllers
Intelligent instruments
Computer equipment
TIWAY I gateways are also available for connecting the Fisher, Foxboro, and
Honeywell networks to TIWAY I. However, you cannot use a gateway and a
UNILINK Host Adapter in the same TIWAY I network. TIWAY I is designed to
satisfy today’s factory requirements for acquiring data and controlling
manufacturing processes. It is a noise-hardened serial binary communications
network that uses an advanced data link protocol.
Series 500 controllers can be connected with PEERLINK for high speed
transfer of small amounts of data between controllers. The PEERLINK is a
solution for applications where one or more Series 500 controllers are
dependent on high speed transfer of data from another Series 500 controller.
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–8
USER MANUAL
With appropriate host software, an operator can program, monitor, and control
any P/C or other intelligent device on the TIWAY I network from a single
location.
The importance of the UNILINK Host Adapter is that it provides a
communication link between the TIWAY I network and one or more host
computers. Figure 1–7 is a diagram representing the various host computers
that can be connected to a UNILINK Host Adapter, and the typical devices that
can be controlled in a TIWAY I network.
PC/
XT/
AT
ICC 6000
CVU 5000
IBM
DEC
DEC
TIPC
PDP–
11
UniLink
Host
Adapter
Y
/
X
S
E
R
T
E
S
1
IBM
Other
M
I
H
I
S
/
M
I
C
R
O
S
NIM
5TI
NIM
SIMATIC
TI520
NIM
SIMATIC
TI560
NIM
SIMATIC
TI565
TIWAY I
NIM
PM550
NIM
SIMATIC
TI530/
TI530C
NIM
Int.
Tank
Xmtr.
PEERLINK
PEERLINK
PEERLINK
PEERLINK
Gateways
Fisher
Honeywell
Foxboro
Others
Map
Secondary
Adapter
Robots
CNC
Int. Scales
Other
Int. Devices
PC/
XT/
AT
Figure 1–7 TIWAY I Network
You cannot use a UNILINK Host Adapter in a TIWAY I network that also
contains a TIWAY I Gateway or Network Control Module (NCM) or a TIWAY I
Host Adapter. Chapter 4 provides information on interfacing the adapter to a
TIWAY I network.
THE UNILINK HOST ADAPTER
UNILINK HOST ADAPTER
1–9
USER MANUAL
1.5
INSTALLATION
Instructions for installing the UNILINK Adapter and the UNILINK Host
Adapter PIM are given in the UNILINK Adapter Installation and Operation
Manual (PPX:TIWAY–8106). It provides the electrical and mechanical
installation instructions and guidelines for the the UNILINK Host Adapter.
Chapter 2 discusses the different operational modes and how they are
configured.
Chapter 3 discusses the host computer interface port, Port 3, and how to set the
dipswitches to establish communications.
Chapter 4 discusses the TIWAY I interface ports, Ports 1 and 2, and how setup
your network.
1.6
TECHNICAL ASSISTANCE
If you need assistance with the installation an operation of this equipment,
contact your Siemens Industrial Automation, Inc. distributor or sales agent. If
you need assistance in contacting your distributor or sales office in the United
States, call 800–964–4114.
1.7
CUSTOMER SERVICE CENTER
If you need assistance in placing an order, returning a product, or learning
about product availability, contact your Siemens Industrial Automation, Inc.
distributor or sales agent. If you need assistance in contacting your distributor
or sales office in the United States, call 800–964–4114.
UNILINK HOST ADAPTER
2–1
USER MANUAL
CHAPTER 2
OPERATION AND APPLICATION
2.1
INTRODUCTION
This chapter provides an introduction to the UNILINK Host Adapter operation
and how it can be used in typical applications. You should refer to Chapter 5 for
the complete command syntax and to the Glossary for help with any unfamiliar
terms. Network planning forms are located in Appendix E, Appendix F, and
Appendix G.
2.2
COMMAND PROCESSING
The UNILINK Host Adapter commands are a set of functional tools to help you
direct network applications. Each command consists of a one-byte command
code and one or more parameters as shown in Figure 2–1. Most parameters
have default values that were selected to help you quickly install an operational
network and expand it with minimal software changes. As your network grows,
you can improve network efficiency by redefining the parameters to match your
network needs. Figure 2–2 illustrates the relative performance and flexibility
gained with using additional commands.
Command
Code
Parameter
#1
Parameter
#2
Parameter
#n
Figure 2–1
Command String Structure
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–2
USER MANUAL
Performance
and
Applications
Flexibility
Basic HIU
Commands
Mode Independent
Commands
Configure Adapter
Commands
Extended HIU
Commands
Network
Manager
Commands
NUMBER OF COMMANDS
Figure 2–2
Performance vs Commands
Communications between the host computer and the UNILINK Host Adapter
are a series of commands and responses as illustrated in Figure 2–3. For every
command sent, there will be a response. The response will be one of the
following.
An acknowledgment that the command was received
A command response
The ERROR RESPONSE
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–3
USER MANUAL
Host
Computer
UNILINK
Host Adapter
Commands
Responses
Secondary
Secondary
Figure 2–3 Host Computer To UNILINK Host Adapter
Communications
Commands are checked for errors before they are executed. The ERROR
RESPONSE is a special response that returns a code indicating the type of
error. If an error is found, the command will not be executed and the ERROR
RESPONSE will be returned. The ERROR RESPONSE will also be returned if a
network request does not complete within the host command timeout. The
possible error codes that may be returned in the ERROR RESPONSE and
corrective actions to take are listed in Chapter 6.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–4
USER MANUAL
2.3
FUNCTIONAL ORGANIZATION AND OPERATING MODES
The UNILINK Host Adapter is organized into two primary functions; the Host
Interface Unit (HIU) function and the Network Manager (NM) function. An
adapter can be configured with one of these functions or they can be combined to
form a Master Host Interface Unit (MHIU). The MHIU, HIU, and NM are three
of the six configurable operating modes.
In addition to the above modes, there are two Emulate Host Adapter (EHA)
modes and a Standalone Network Manager (SANM) mode.
2.3.1
Host Interface Unit Function
The primary purpose of the Host Interface Unit (HIU) function is to establish
communications between the host computer and the secondary devices on a
TIWAY I network. The HIU uses the memory in the adapter for macro buffers
and to store host-to-secondary statistics as shown in Figure 2–4. Macro buffers
are used to store macro commands and responses. Macros provide a method for
connecting, disconnecting, or sending a Primitive to a secondary device without
delays in host processing. Macros are discussed further in Paragraph 2.10.1.
Commands are received from the host computer and checked for validity. Then
the host requests are processed and queued to the Network Manager function
for routing to the appropriate secondary device. The Master Host Interface Unit
(MHIU) mode combines the HIU function and the Network Manager function.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–5
USER MANUAL
HIU
Establishes communications
Uses memory for:
Macro Buffers
between the host computer
and the secondary devices.
(Dynamically allocated)
Host–to–Secondary Statistics
Figure 2–4
Host Interface Unit Function
Part of the statistics memory area is used for a Secondary Log. As commands are
issued to connect and disconnect secondaries, the specified secondary address is
added or deleted from the Secondary Log and a network request is queued into
the Network Manager.
In the background, the adapter is continuously collecting statistics on the
number of commands processed, transactions completed on the network, and
other items. Commands to retrieve these statistics do not require network
transactions, but return the information from the appropriate statistical area.
The following operating modes include the HIU function.
Master Host Interface Unit (MHIU)
Host Interface Unit (HIU)
Master Host Interface Unit/Emulate Host Adapter (MHIU/EHA)
Host Interface Unit/Emulate Host Adapter (HIU/EHA)
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–6
USER MANUAL
2.3.2
Network Manager Function
Acting as the network primary, the Network Manager function is responsible
for controlling the message traffic on the TIWAY I network as shown in Figure
2–5. It receives the requests from HIUs and stores them in a NM buffer, routes
them to the designated secondary devices, and returns the secondary response
to the HIU that issued the request. There can be only one adapter configured
with the Network Manager function in any particular TIWAY I network.
This function will only process Network Manager commands. These commands
control the TIWAY I network operations, return network statistical information
and handle the background monitor and redundant media switching
operations. All network requests and responses are queued in the Network
Manager buffers area.
NM
Manages the message traffic on
the TIWAY I network.
Uses memory for:
Network Buffers
Network Stations
Figure 2–5 Network Manager Function
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–7
USER MANUAL
The following operational modes include the NM function. However, the
MHIU/EHA mode does not provide access to the NM command set.
Master Host Interface Unit (MHIU)
Network Manager (NM)
Standalone Network Manager (SANM)
Master Host Interface Unit/Emulate Host Adapter (MHIU/EHA)
2.3.3
The Master Host Interface Unit Mode
The Master Host Interface Unit (MHIU) is a combination of the HIU and NM
functions as shown in Figure 2–6. A host computer connected to an MHIU can
communicate with secondary devices through the HIU function and control
network performance through the NM function. Remember, only one adapter in
a TIWAY I network may have the NM function.
HIU
NM
MHIU
Figure 2–6 Master Host Interface Unit Diagram
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–8
USER MANUAL
2.3.4
Typical Network Applications
Both single and multiple host networks are supported by the UNILINK Host
Adapter. Figure 2–7 illustrates a typical single host network which uses an
MHIU as the host interface and network manager.
Host
Com-
puter
UNILINK
TIWAY I
UniLink Host Adapter ( MHU)
RS–232–C/RS–4
23–A
Host Interface
Cable
Figure 2–7 Typical Single Host Network
Multiple host networks can be configured with a variety of adapters in different
operating modes as illustrated in Figure 2–8 and Figure 2–9. Since the NM
function is not in the same adapter with the HIU function in Figure 2–9, the NM
and HIUs can use the total memory resources of the adapters for their
respective needs. This could be an advantage in large networks where the
additional memory for NM buffers will increase network performance.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–9
USER MANUAL
Host
Com-
puter
UNILINK
UniLink Host
Adapter (MHU)
Host
Com-
puter
UNILINK
UniLink Host
Adapter (MHU)
Figure 2–8 Typical Multiple Host Network
Host
Com-
puter
UNILINK
(HIU)
Host
Com-
puter
UNILINK
(HIU)
UNILINK
Host
Com-
puter
Figure 2–9 NM Network
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–10
USER MANUAL
2.3.5
The Emulate Host Adapter Modes
There are two modes available that provide an emulation of the TIWAY I Host
Adapter; the MHIU/EHA and the HIU/EHA. These modes are limited to the
base command codes 01 through 08, 20, 21, and FC through FF. The POLL
command, code 03, is not available in the HIU/EHA mode. Both of these modes
will operate with applications software written for the TIWAY I Host Adapter.
The MHIU/EHA can directly replace the TIWAY I Host Adapter in single host
network applications. However, the MHIU/EHA cannot be used in a multiple
host network. The HIU/EHA provides the ability to use TIWAY I Host Adapter
software applications in a multiple host network.
2.3.6
The Standalone Network Manager Mode
The Standalone Network Manager mode operates independent of any host
computer. It controls the TIWAY I network, but cannot accept any host
commands to change any performance parameters. You can use this mode to
implement a multiple host network using applications software written for the
TIWAY I Host Adapter. Only minor changes to the applications software are
needed to process the adapter configuration command. A typical network is
shown in Figure 2–10.
Host
Com-
puter
UNILINK
(HIU)
Host
Com-
puter
UNILINK
(HIU)
UNILINK
(SANM)
Figure 2–10 Standalone NM Network
2.4
TIWAY I HOST SOFTWARE SUPPORT
As mentioned in Paragraph 2.3.5, the MHIU/EHA and HIU/EHA modes will
operate with the TIWAY I HOST SOFTWARE products. The MHIU and NM
modes will also work with this product; however, you must enclose the extended
and NM commands in the XPAR subroutine.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–11
USER MANUAL
TIWAY I Host Software can be used with adapters in a multiple host network.
However, you must define an HIU address using the XPAR subroutine and the
CONFIGURE HIU command, and you cannot use the POLL command.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–12
USER MANUAL
2.5
SETTING THE OPERATING MODE
Each adapter must be configured for one of the six possible operating modes.
The mode is configured with the CONFIGURE ADAPTER command with the
exception of the Standalone NM mode, which is chosen by setting Positions 9
and 10 of Dipswitch 1 down. The defaults and dipswitch settings are discussed
further in Paragraph 2.5.1. There are three configuration commands; the
CONFIGURE ADAPTER command, the CONFIGURE HIU command, and the
CONFIGURE NM command.
2.5.1
Configuration Defaults and Dipswitch Settings
Most of the parameters associated with the configuration commands have
default values chosen to help you install an operating host interface with a
minimum amount of effort. As your network expands and you gain experience
with the advanced commands, you can change the defaults to tailor the network
performance to your needs.
The adapter has two 10-position dipswitch banks, located behind the front
access door as shown in Figure 2–11. Most of the settings on the dipswitches
relate to the parameters for the host and TIWAY I ports. However, the setting of
Position 9 on Dipswitch 2 determines the default mode value. When Position 9 is
up, the adapter will default to an HIU/EHA and when Position 9 is down, the
adapter will default to an MHIU/EHA.
LEDs
Reset
Number 2
Number 1
Figure 2–11 Dipswitch Positions
The default mode will be chosen when you issue one of the Base HIU commands
before issuing the CONFIGURE ADAPTER command. In the later case, the
adapter assumes the default mode from the setting of Position 9 on Dipswitch 2
and assumes the EHA mode. This means that after the adapter is reset, if you
issue any of commands 01 through 08, the adapter will assume the MHIU/EHA
or HIU/EHA mode depending on the setting of Position 9.
2.5.2
The CONFIGURE ADAPTER Command
The first command your application software should send is the CONFIGURE
ADAPTER command, code 20. The main function of this command is to set the
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–13
USER MANUAL
operating mode to the value specified. The only operating mode that can not be
set with this command is the Standalone Network Manager (SANM), since it
can not accept any host computer commands. Instead, the SANM mode is
selected by dipswitch settings described in Chapter 3 and Chapter 4. Each host
computer must send this command to its attached UNILINK Host Adapter(s).
The mode remains in effect and can not be changed until the adapter is reset.
The parameters for this command specify the HIU address, the maximum
secondary device address, and the macro memory limit.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–14
USER MANUAL
At any time, your applications software can retrieve the current values for these
parameters by issuing the REPORT ADAPTER CONFIGURATION command,
code 21. In addition to those parameter values, this command will also return
the values of the dipswitch settings and a flag that indicates whether the
CONFIGURE ADAPTER command was previously processed.
The physical network parameters for the HIU function of an MHIU are not
used, but the CONFIGURE ADAPTER command must still be sent to enable
the HIUs network interface.
2.5.3
The CONFIGURE HIU Command
The CONFIGURE HIU command defines the network parameters for an HIU
function and enables the HIUs TIWAY I interface for both an MHIU and an
HIU. The options and associated parameters can occur in the command string
in any order, but they can not occur twice in the same command. This command
can only be issued once and if successful, the command code, 11, will be
returned.
The REPORT HIU CONFIGURATION command, code 12, will return the
values of the dipswitches, HIU Options, and a flag indicating whether the
configuration has been performed.
2.5.4
The CONFIGURE NETWORK MANAGER Command
The CONFIGURE NETWORK MANAGER command, code 30, defines the
operating parameters for the network ports in the NM and MHIU modes and
specifies network options such as auto redundant media.
Issue the REPORT NETWORK MANAGER CONFIGURATION command,
code 31, to retrieve the dipswitch settings and the current values for the
Network Manager parameters and to determine if the CONFIGURE
NETWORK MANAGER command has been processed. In a multiprocessing
environment, the tasks can check the configuration processed flag to determine
whether or not they can begin issuing commands to the adapter.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–15
USER MANUAL
2.5.5
Configuring the Standalone Network Manager
The Standalone Network Manager (SANM) mode is configured completely with
dipswitch settings. The definition for some of the dipswitch positions is different
for this operating mode as shown in Figure 2–12. The SANM mode is selected by
defining the host command timeout as zero by setting Positions 9 and 10 of
Dipswitch 1 down. The other positions of Dipswitch 1 define the TIWAY I
network parameters.
"
"
"
!
!
#
#
"
"
$
"
"
"
Figure 2–12 Standalone Network Manager Dipswitch Settings
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–16
USER MANUAL
Since the SANM cannot accept any NM commands, Positions 1–7 of Dipswitch 2
define certain Network Manager function options normally configured with the
CONFIGURE NETWORK MANAGER command.
When Position 1 of Dipswitch 2 is up, it selects a one-half second delay
after CTS is active. No delay is selected when the dipswitch is down.
When Position 2 of Dipswitch 2 is up, all HIUs are given permission to
issue a network disconnect (DISC). This permission is granted by the
NM function when it initializes the HIU. No HIUs will be given
permission to issue a DISC when the dipswitch is down.
Positions 3–6 of Dipswitch 2 represent the binary value for the number
of NM buffers to assign to an HIU when the HIU is initialized. The
number of NM buffers can range from 1 to 16. The actual binary value
selected will range from 0000 to 1111 binary where Position 3 is the most
significant bit and Position 6 is the least significant bit. The adapter will
then add 1 to the binary value to scale the actual range to 1–16.
When Position 7 of Dipswitch 2 is up, the NM function will use the
redundant media feature that uses both network ports, Ports 1 and 2, to
communicate with the secondary devices.
2.5.6
Configuration Summary
The general procedure for configuring the adapter follows in the list below.
1.
Set the dipswitch positions.
2.
Issue the CONFIGURE ADAPTER command.
3.
Issue the CONFIGURE NM command. (If this adapter will be an MHIU
or a NM)
4.
Issue the CONFIGURE HIU command. (If this adapter will be an
MHIU or an HIU)
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–17
USER MANUAL
2.6
SPECIAL NETWORK MANAGER FEATURES
The adapter provides two special features in the MHIU and NM operating
modes. First is the redundant media channels with selectable automatic media
channel switching. Second is the background monitor that will bring devices
online dynamically.
2.6.1
Redundant Media Channels
The adapter provides for two network media channels, Ports 1 and 2, described
in more detail in Chapter 4 . You may select to use only one channel or both by
specifying the appropriate value in the CONFIGURE NETWORK MANAGER
command. Using redundant media increases the mission reliability of the
network or the probability that the network will remain operational when a
random failure occurs. When first initialized, the adapter will communicate on
Channel A or Port 1. Your applications software can then issue the SWITCH
CHANNEL command at any time to change the operating channel for one,
several, or all secondary devices. The channel can be switched even if the auto
redundant media feature is not active; however, if it is active, the Network
Manager function will switch the channel back if a failure occurs. Channel B or
Port 2 must be available or an ERROR RESPONSE will be returned when you
try to issue this command. If the command is accepted, the adapter will return
the command code and the channel code.
The primary function of redundant media is to provide a second
communications path in the event of a failure on the primary path. This can also
be used as a maintenance aid by switching all secondaries to the alternate
channel so that the main channel can be maintained without completely
shutting the network down. Remember, only one media or channel can be
transmitting or receiving in a given instance.
The auto redundant media feature allows the Network Manager function to
automatically switch a secondary device to the opposite channel if
communications can no longer continue on the current channel. The secondary
device
will
be
switched
if
it
fails
to
respond
consecutively
in
maximum-retry-count times. The maximum retry count is specified in the
CONFIGURE NETWORK MANAGER command and defaults to 3 times. Once
the secondary has been switched, the Network Manager function will attempt
to communicate again on the new channel up to the maximum retry count. If the
secondary responds, communications will continue on this channel. If the
secondary fails to respond, the secondary will be logged as off-line and all
associated macros will be disabled. All macro response status words will be
updated to indicate that the secondary is off-line, and any network requests
that were pending will return the ERROR RESPONSE.
2.6.2
Background Monitor
Background monitor is a feature of the Network Manager that instructs it to
periodically check the link status of each secondary device. This feature is
active in the Network Manager function in all but the EHA modes and the
SANM mode. The link status information includes the communications status
for each channel and for each secondary, whether the secondary is online or
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–18
USER MANUAL
offline, and if the secondary is an HIU. The Network Manager normally cycles
through the secondary device log and checks to see if there are any outstanding
directives or responses. In addition, it will also select one secondary device
address per cycle to perform a link status check. The selected secondary address
initially begins with secondary number one and continues with the next
secondary address number until reaching the maximum secondary address
specified in the CONFIGURE ADAPTER command. Background monitoring
then starts over again with address one.
The current link status determines what action to take when monitoring a
device. If the current link status for the selected secondary address is offline,
the Network Manager will issue the initialization sequence. If there is no
response, the Network Manager will assume that the device is not in the
network and will not retry the message. If the device does respond, its status
will be updated and if it is an HIU, buffers will be allocated. This means that any
time that a valid secondary device is connected to the network, it will be brought
online.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–19
USER MANUAL
If the background monitor detects a secondary that went offline and the auto
redundant media feature is active, the Network Manager will attempt to
contact the secondary on the alternate channel as described in the Redundant
Media section above.
You can obtain peak performance by consecutively numbering your secondary
devices and HIUs, starting with address 01, and by setting the largest
secondary device address value in the CONFIGURE ADAPTER command. This
will keep the Network Manager from spending time on device addresses that
will never exist on the network. Your applications software can request the link
status information with the REPORT SECONDARY LINK STATUS command,
code 32.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–20
USER MANUAL
2.7
THE HIU AS A SECONDARY
The HIU function appears as a special secondary device to the NM function. In
addition to queuing network requests for the NM function to process, the HIU
function will respond to TIWAY I Primitives 02 — Machine Status, 03 —
Machine Type/Configuration, and 04 — Primitive Format Configuration. The
TIWAY I Systems Manual provides more details on the format and use of
Primitives.
2.7.1
Primitive 02 Response
The Primitive 02 response will be returned as follows (spaces were added for
clarity).
LLLL 02 HH DD EE FF
Where
LLLL is the Primitive length,
HH will be 00 indicating that it is operational and
performing instruction execution,
DD will be 01 indicating that the Auxiliary Power Source
Status is not available,
EE will be 00 indicating that the NIM is operational,
FF will be 00 and has no meaning for an HIU.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–21
USER MANUAL
2.7.2
Primitive 03 Response
The Primitive 03 response will be returned as follows.
LLLL 03 HH DDDD EEEE FFFF GGGG IIII JJJJ KKKKKKKK
Where
LLLL is the Primitive length,
HH will be 00 indicating that it is operational and
performing instruction execution,
DDDD will be 007E indicating that the device type is
an HIU,
EEEE, FFFF, GGGG, IIII, JJJJ will be 0000,
KKKKKKKK will be 00000000.
2.7.3
Primitive 04 Response
The Primitive 04 response will be returned as follows.
LLLL 04 NNNN MM EE FF GG
Where
LLLL is the Primitive length,
NNNN will be 010E and indicates the maximum Primitive
length supported,
MM, EE, FF, GG will be 00.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–22
USER MANUAL
2.8
MODE INDEPENDENT OPERATIONS
The mode independent commands perform hardware and software resets, and
external I/O point operations regardless of the operating modes.
2.8.1
Reset Commands
There are two reset commands that can be sent to the UNILINK Host Adapter
regardless of the operating mode. The reset commands should be used
cautiously because they clear all macros and configuration parameters, and
discard any outstanding operations on the network. The first is the SOFT
RESET command, code FE. This command causes the adapter to execute a
software reset operation. All current TIWAY I operations will be aborted and the
adapter will go into a startup state without performing power up diagnostics.
The command code will be returned as a response and the reset will begin
immediately after sending the response to the host. Your applications software
should not issue another command for at least 500 ms.
The second reset command is the RESET ADAPTER command, code FF. The
reset will begin within one second after the reset command response is returned
to the host. Your applications software should allow an additional five second
delay before issuing another command to allow the diagnostics to complete.
The response to either reset command will not be returned until the adapter is
polled when using the host BDLC protocol. Chapter 3 provides more
information on host interface protocols.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–23
USER MANUAL
2.8.2
The External Input/Output Points
The UNILINK Adapter provides a single external input point and a single
external output point. These two points operate independently and can be used
in a variety of applications like a remote “Adapter Good” indicator. For safety
critical applications, any external alarms should be hard-wired independently
of the P/C.
IN
OUT
UNILINK Host
Adapter
Panel
Lamp
20 – 40 VDC
20 – 36 VAC
(RMS)
Remote
“ADAPTER GOOD”
Indicator
Figure 2–13 External Input/Output Points Example Application
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–24
USER MANUAL
2.8.2.1
The External Input Point
The input point latches a high level. The option parameter of the REPORT
EXTERNAL INPUT STATUS command determines when to reset and latch the
external input. The values for the command option are:
00 = Read the input, do not reset the latch.
01 = Read the input, then reset the latch.
02 = Reset the latch, then read the input.
Options 00 and 01 report whether the “on” condition ever occurred, but not
report the current state of the external input point. Option 02, however, reports
the instantaneous value of the input and should be used for time dependent
applications. The response will be either 00 indicating that the input is off, or 01
indicating that the input is on. The complete specifications for the input point
are given in the UNILINK Adapter Installation and Operation Manual
(TIWAY–8106).
2.8.2.2
The External Output Point
The MODIFY EXTERNAL OUTPUT STATUS command either turns the
external output point ON or turns it OFF. The corresponding voltage levels are
given in the UNILINK Adapter Installation and Operation Manual
(TIWAY–8106). The command code FC, along with either 00 or 01 will
respectively turn off or turn on the output point. The adapter will return the
command code in response. The initial state of the External Output Point is zero
after a reset or power-up. A remote “Adapter Good” lamp can be set up using this
point by connecting it to a remote control center panel lamp so that when the
host computer applications software issues the MODIFY EXTERNAL
OUTPUT STATUS command to turn on the output point, the lamp will light. If a
problem occurs that causes the adapter to reset, the lamp will be extinguished.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–25
USER MANUAL
2.9
BASIC NETWORK OPERATIONS
The simplest network operations, in either a single or multiple host network,
are performed using the Base HIU commands, codes 1–8. These commands
allow you to bring secondary devices online and offline, send data to/from the
secondaries, and retrieve basic statistics. However, these commands are direct
issue requests, meaning that the host application must wait for the network
response before another command can be issued. Paragraph 2.10 discusses how
to process multiple outstanding transactions.
2.9.1
Bringing Secondary Devices Online
Issue the CONNECT SECONDARY command to bring secondary devices
online. This command logically connects one or more secondary devices and
allows your applications software to selectively connect the secondary devices
on the network. Memory space will be allocated for secondary device statistics
the first time that the secondary is connected. This space will remain in use
until the adapter is reset.
The address value FF hex or 255 decimal has been reserved as a global address
that will connect all secondaries up to the largest address value, specified when
the adapter was configured. You must be careful when requesting multiple
secondary connections. If the responses are not received before the host
command timeout, the ERROR RESPONSE will be returned and you will have
to issue the READ SECONDARY LOG command to determine which
secondaries were connected before the timeout. A successful connection will
return the command code and a list of the secondary device addresses that were
connected successfully. If no address in the list was connected, the response will
be the command code and a 00 address value.
NOTE
The host computer must wait for the response to be
returned for the CONNECT SECONDARY and
READ SECONDARY LOG commands before issuing
another command, regardless of the adapter
operating mode. There can be a long time delay when
using the special global address (FF hex).
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–26
USER MANUAL
2.9.2
Sending Data To And From Secondary Devices
After the secondary device is connected, your applications software can send
TIWAY I Primitives to the secondary with the SEND NETWORK DATA
command or the BROADCAST NETWORK DATA TRANSFER command. The
TIWAY I Primitives provide control functions such as reading and writing data
elements, controlling the operating mode, and testing the status and
configuration of the secondary devices.
The SEND NETWORK DATA command transfers a TIWAY I Primitive to a
specified secondary device. When completed, the adapter will return the
command code, the secondary address, and the Primitive response.
NOTE
The host computer must wait for the response to be
returned for the SEND NETWORK DATA and
BROADCAST NETWORK DATA commands before
issuing another command, regardless of adapter’s
operating mode.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–27
USER MANUAL
The BROADCAST NETWORK DATA TRANSFER command will send the
Primitive to all logically connected secondary devices on the network and is
provided for backward compatibility with the original TIWAY I Host Adapter.
The Broadcast/Poll sequence is more efficiently handled with macros discussed
in Paragraph 2.10. Unlike the SEND NETWORK DATA command, the
responses from the secondaries do not automatically return. If the command is
accepted, the command code will be returned, then your applications software
MUST issue a POLL command to each secondary to collect the Primitive
response.
CAUTION
You
should
not
issue
the
BROADCAST
NETWORK DATA TRANSFER command if your
network
contains
Intelligent
Tank
Transmitters (ITTs) as secondary devices or
you could loose responses. Also, sending a
BROADCAST NETWORK DATA TRANSFER
command when your adapter is configured as
either an MHIU or an HIU will cause an
network HDLC error to be logged even though
the information was received. This error will
be included in the statistics from the READ
SECONDARY DIAGNOSTICS, REPORT HIU
STATUS, REPORT NETWORK MANAGER
SECONDARY STATISTICS and the REPORT
NETWORK
MANAGER
NETWORK
STATISTICS commands.
The POLL command can only be used by an adapter configured as an
MHIU/EHA, however, the broadcast/poll sequence can be implemented in other
operating modes with macros. Example 2–1 is a typical sequence for the
broadcast/poll commands.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–28
USER MANUAL
02 0002 11 00
02
03 01
03 01 0002 11 01
03 02
03 02 0002 11 01
03 03
Issue Broadcast command
Accepted response
Poll address #1
Address #1 response
Poll address #2
Address #2 response
Poll remaining addresses
Example 2–1
BROADCAST/POLL Example
2.9.3
Retrieving Secondary Statistics
The UNILINK Host Adapter maintains network statistics for the logically
connected secondaries on the network. This information is not essential for
normal operation, but can be useful for identifying problems.
The first statistical command is the READ SECONDARY LOG command, code
06. When this command is received, the UNILINK Host Adapter will respond
with the command code followed by the list of secondary device addresses that
are logically connected. If no secondaries are connected, the list will contain one
byte with a value of 00.
The second command is the READ SECONDARY DIAGNOSTICS command.
This command returns statistical counters for the network HDLC
transmissions and errors. Along with the command code and secondary
address, there is a reset statistics counters parameter. The counters are not
automatically reset when their maximum value is reached. The reset
parameter allows your applications software to reset the counters to start a
baseline measurement.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–29
USER MANUAL
2.9.4
Taking Secondary Devices Off-line
The DISCONNECT SECONDARIES command performs the opposite function
of the CONNECT SECONDARIES command. The secondary devices listed
after the command code are logically disconnected and their addresses removed
from the secondary log. Again, the special address code FF, instructs the
UNILINK Host Adapter to attempt to disconnect all logically connected
secondaries. You must be careful when disconnecting more than one secondary
device. The command may be aborted if all secondaries are not disconnected
before the host command timeout expires and the ERROR RESPONSE will be
returned. The normal response returned will be the command code and a list of
secondaries that disconnected properly. If none of the addresses in the list were
connected, the response will be the command code and a 00 address value.
The HIU function must have permission to issue a disconnect to a secondary
before the secondary is actually taken offline. If the permission is not granted,
the secondary device will be removed from the secondary log, but will remain
online. Option–09 of the CONFIGURE NETWORK MANAGER command
defines the default for granting this permission by the background monitor. In
addition, the ALLOCATE NETWORK MANAGER BUFFERS command can
specify the permission.
2.9.5
Retrieving Adapter Statistics
The READ ADAPTER DIAGNOSTICS command, code 08, is another aid to
identifying processing problems. This command retrieves a list of counters
indicating the number of times that each Base HIU command has been
processed. This will help build a profile of which commands are processed most
often and will indicate possible bottlenecks. Like the counters for the secondary
statistics, these counters are not automatically reset when the maximum limit
of is reached.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–30
USER MANUAL
2.10
EXTENDED NETWORK OPERATIONS
The Extended HIU (EHIU) commands provide several performance
improvement benefits through macros and bandwidth adjustments.
2.10.1
What Are Macros?
Normally, when the host computer issues a network request to connect,
disconnect, and send data to and from secondary devices, it must wait for the
response to be returned. Macros are network requests that are stored and
scheduled for independent processing by the HIU function. The HIU function
will issue the network request at the proper time and store the response. This
frees the host computer to issue other commands and retrieve request
responses without the burden of real-time host computer control. The HIU
function is free to schedule macro transmissions and collect responses, so that
new macro requests can be issued to the NM function while waiting for older
ones to complete processing in the secondary devices. This keeps the network
efficient and increases data throughput.
2.10.1.1
Configuration Modes Supporting Macros
Table 2–1 Configuration Modes Supporting Macros
Macros supported?
No
MHIU
EHA
No
HIU
EHA
Yes
MHIU
Yes
HIU
No
NM
No
NM
SA
The UNILINK Host Adapter must be configured as either a Master Host
Interface Unit or a Host Interface Unit to use the macro feature. These two
operating modes accept the extended host commands for defining macros and
collecting macro responses. Macros are not supported in the Emulate Host
Adapter modes.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–31
USER MANUAL
2.10.1.2
Repetitive and Non-Repetitive Macros
You specify in each macro definition whether the macro should be issued one
time or repeated at regular time intervals. Non-repetitive macros are issued
once and collect one macro response, functioning much like a direct command.
To reissue the non-repetitive macro, your applications software only needs to
send the ENABLE/DISABLE MACRO EXECUTION command to enable it,
saving the host-to-adapter communications overhead of sending the Primitive
data again.
Repetitive macros are issued at the specified time intervals with each new
macro response replacing the previous response. The macro will be repeated
until your applications software sends the ENABLE/DISABLE MACRO
EXECUTION command to disable it. Both repetitive and non-repetitive macros
are scheduled for processing by the HIU function.
The HIU function schedules the requests in the following order:
1.
Direct commands for a single secondary device
2.
Direct commands for multiple secondary devices
3.
Non-repetitive macros
4.
Repetitive macros
The HIU function queues all requests except the direct commands for single
secondaries. A single secondary direct command is given a higher priority and
will be sent to the NM function before any of the queued requests. This priority
scheme prevents the repetitive macros from using the entire network
bandwidth.
When the ENABLE/DISABLE MACRO EXECUTION command code is issued,
the non-repetitive macros will be sent in the order listed in the command
parameters. The provides a method for defining your own execution priority for
the non-repetitive macros. Repetitive macros can be used for background data
acquisition, freeing the host computer application even further. Each new
repetitive macro response is compared to its previous response and if a
difference is detected, the exception flag for that macro is set. The host computer
application can check the state of the exception flag and act accordingly without
the overhead of collecting and comparing the macro responses itself. A Freeze
Exception option can be specified when defining the repetitive macros. This
option will disable the macro execution when the exception is detected, and
freeze the data that caused the exception.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–32
USER MANUAL
2.10.2
The Parts of a Macro
MACRO HEADER
MACRO COMMAND BUFFER
MACRO RESPONSE BUFFER
Figure 2–14 The Parts of a Macro
Each macro is stored in a variable length buffer. The macro buffer is referenced
by a unique buffer number assigned by the HIU function when the buffer is
allocated. This buffer number ranges from 1 to 254 (01 hex to FE hex) so that up
to 254 buffers can be allocated, depending on the size of each macro and the
amount of memory set aside for the macro buffers. Each macro buffer consists of
command and response buffers referenced by the same unique buffer number
and a macro header as shown in Figure 2–14. You specify the size of each macro
command buffer and its corresponding macro response buffer in the
ALLOCATE MACRO BUFFER command. Use the following formula to
calculate the number of bytes of memory required for each macro:
Macro Memory = 22 Bytes + Macro Command + Macro Response
(Header)
Buffer Length
Buffer Length
If this total is an odd number of bytes, add one to make the total count even.
The header is a storage area for the macro operating parameters, one of which is
the Macro Response Status Word (MRSW). The MRSW is normally a counter
that holds the number of times a repetitive macro has been executed. However,
if an error or exception occurs, a termination code indicating the cause of the
error will be stored there. Send the GATHER MACRO RESPONSE command to
get the MRSW value. The header also contains the Source Id and the secondary
address associated with the macro, and internally used pointers and flags.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–33
USER MANUAL
The total macro memory requirements can be calculated by summing the
memory for each individual macro. For example, suppose that you use one
macro to connect secondary #7, another macro to issue a Primitive 45 bytes long
expecting a response 30 bytes long, and another macro to disconnect secondary
#5. The total memory required for these three macros is:
Macro #1, Connect
= 22
= 22
22
Macro #2, Primitive
= 22 + 45 + 30
= 97(+1)
98
Macro #3, Disconnect
= 22
= 22
22
Total Memory Required
142 Bytes
Example 2–2 Macro Memory Requirements
Host
Computer
UNILINK
TIWAY I
UniLink Host Adapter
Job Directory
Job A
Job B
Job C
Figure 2–15 Host Computer Multiprocessing Application
Example
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–34
USER MANUAL
The UNILINK Host Adapter also supports multiprocessing in host computer
applications through the host assigned Source Identification number. This
number associates each host task with corresponding macros, preventing one
task from interfering with another’s resources. Up to thirty-two independent
host tasks can be in use at any one time, each assigned a unique value, from 1 to
254. The Source ID can also be used in single task environments to group
related subtasks and gather their responses.
2.10.3
The Macro Commands
Macros are defined and maintained with the following commands.
ALLOCATE SOURCE ID
ALLOCATE MACRO STORAGE BUFFERS
DEFINE MACRO
GATHER MACRO RESPONSE
ENABLE/DISABLE MACRO EXECUTION
INITIALIZE MACRO RESPONSE BUFFER
LINK MACRO
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–35
USER MANUAL
2.10.4
Setting Up A Macro
Figure 2–16 flowcharts the steps for setting up macros. Commands for checking
available memory are not included in the flowchart, but are described in the
sections that follow.
Allocate A
Source ID
Allocate A
Macro Buffer
Define the Macro
More Macros
for the same
source?
(START)
Figure 2–16 Macro Setup Procedure
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–36
USER MANUAL
2.10.4.1
Allocate A Source Identification Number
Use the ALLOCATE SOURCE ID command, code 10, to specify a Source
Identification number which can range from 1 to 254 (01 to FE hex). Only
thirty-two unique Source Identification numbers can be used at any one time.
Figure 2–17 illustrates the relationship between Source Ids and macro buffers.
Source ID #1
(OE)
Source ID #2
(1A)
Source ID #32
(E5)
Macro Buffer
#1
Macro Buffer
#35
Macro Buffer
#63
Macro Buffer
#87
Macro Buffer
#2
Macro Buffer
#3
Macro Buffer
#80
Macro Buffer
#97
Macro Buffer
#109
Macro Buffer
#4
Macro Buffer
#33
Macro Buffer
#60
Up to 32
unique
source
IDs
Up to 254
Macro
Buffers
Figure 2–17 Relationship Between Source Ids and Macro
Buffers
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–37
USER MANUAL
If this command is accepted, the UNILINK Host Adapter will echo back this
same command string, otherwise the ERROR RESPONSE will be returned.
Source Ids can also be used to group network responses, such as the status of
each device. Only one Source Identification number is allocated with each
command sent to the UNILINK Host Adapter.
WARNING
All existing macro buffers for the Source
Identification number will be cleared when the
ALLOCATE
SOURCE
ID
command
is
processed.
This
prevents
a
task
that
abnormally
terminated
from
allocating
additional
resources
while
the
original
resources remain allocated, but unused. Make
sure that your application programs use
unique Source Identification numbers.
2.10.4.2
Allocate The Macro Buffers
Use the ALLOCATE MACRO STORAGE BUFFERS command, code 13, to
define and specify the length for both the macro command buffer and the macro
response buffer. The UNILINK Host Adapter will return the buffer number
assigned by the HIU. Store the buffer number in your application program for
later reference. If you specify more than one buffer pair in the command, more
than one buffer number will be returned in the response. Be sure to allocate a
sufficient length of memory for both the macro command buffer and the macro
response buffer.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–38
USER MANUAL
2.10.4.3
Define The Macro
Use the DEFINE MACRO command, code 14, to define the macro and the macro
options. Figure 2–18 shows the DEFINE MACRO command frame. Macros can
connect a secondary, disconnect a secondary, or send a Primitive to a secondary.
These three functions are the macro types as shown in Table 2–2. The “connect”
and “disconnect” secondary macro types do not require any buffer storage to
hold the command, only 22 bytes for the header.
Figure 2–18 Macro Command Frame
Table 2–2 Macro Types
Type
Code
01
02
03
Function Performed
Send Primitive to secondary
Connect the secondary
Disconnect the secondary
The UNILINK Host Adapter will return the Command Code, the Source
Identification number, and the buffer number to indicate that the command
was accepted. However, this does not mean that the secondary was actually
connected because macros are scheduled for later execution. When the
“connect” secondary macro is executed, the MRSW will be set to indicate if the
connect was successful or if not, why it failed. The “disconnect” secondary macro
type works just like the “connect” secondary type except that the secondary is
disconnected rather than connected. Both the “connect” and “disconnect”
secondary macro types are automatically enabled for execution when the
command is accepted from the host computer.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–39
USER MANUAL
The third macro type is “send Primitive” which is functionally equivalent to
using the SEND NETWORK DATA command, but is far more flexible. This
macro begins with the same bytes as the two other types with the addition of a
macro options byte, a minimum reissue delay time word, and the Primitive
data. The macro options byte uses its five most significant bits to enable or
disable the following options.
The auto enable option which specifies whether to automatically enable
the macro for execution after definition is complete or not. If you do not
choose this option, you can explicitly enable the macro with the
ENABLE/DISABLE MACRO EXECUTION command.
The repetitive/non-repetitive option which defines how the macro will
be executed.
The freeze option which selects whether to freeze the macro and
response when an exception occurs.
The set first exception option which selects whether to set the exception
flag on the first response.
Unlike the two other macro types, the “send Primitive” macro type is not
implicitly enabled for execution. You must set Bit 0 to a value of 1 or use the
ENABLE/DISABLE MACRO EXECUTION command before the macro will be
scheduled for execution. The last option, Bit 4, causes the HIU to not check the
first macro response received for an exception. When the macro response buffer
is first allocated, its contents are undefined which will cause the first response
received to set the exception flag. Setting Bit 4 will prevent this exception, or
you can initialize the contents of the macro response buffer with the
INITIALIZE MACRO RESPONSE BUFFER command. Example 2–3 shows
examples of the bit coding for various combinations.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–40
USER MANUAL
MSB LSB Byte ACTIONS
(hex)
0 0 0 0 0 0 0 0 = 00
Non-repetitive, must be explicitly
enabled,
1 1 0 0 0 0 0 0 = C0
Repetitive, auto enabled, will not
freeze exception
0 1 1 1 0 0 0 0 = 70
Repetitive, must be explicitly enabled,
will freeze exception data, will not
check first response for an exception
Example 2–3 Macro Options Byte — Bit Coding
The minimum macro reissue delay time word or double byte specifies the
number of milliseconds to delay before reissuing a repetitive macro. The delay
time ranges from 0 to 30,000 milliseconds in 10 millisecond increments. This
option only specifies the minimum time to delay the macro and should not be
used for time dependent applications. Heavy network loading could cause the
macro to be delayed longer than this minimum delay.
You can redefine a macro, but it must be disabled first with the
ENABLE/DISABLE MACRO command, which will clear the exception flag and
discard any outstanding responses.
2.10.5
Checking The Macro Response and Macro Status
The GATHER MACRO RESPONSE command collects one or more macro
responses. You can choose to retrieve the entire macro response buffer data
along with the Macro Response Status Word (MRSW) or just the MRSW. You
can also choose to retrieve all the buffers specified or just those with their
exception flags set. In addition to the command code, specify the Source
Identification number, the response type, and the buffer number or numbers.
The response type byte can be either code 00, 01, or 02. Code 00 instructs the
UNILINK Host Adapter to return all of the buffer data including the MRSW.
Code 01 will return all of the buffer data, but only for the requested buffers with
their exception flags set. Code 02 will return only the MRSW, for the requested
buffers that have their exception flags set. The macro response exception flag is
reset each time that the buffer data is retrieved with response type codes 00 and
01; it is not reset with response code 02.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–41
USER MANUAL
You can request more than one buffer at a time; however, be sure that the total
combined length of each buffer response does not exceed the maximum message
length, or the ERROR RESPONSE will be returned. The Primitive data must fit
into one host response I-Frame.
The secondary address, MRSW, Primitive data length, and the Primitive data
will be returned for each buffer number requested that meets the response type
condition. Specifying buffer number 00 is a special case that ignores the value in
the response type byte. In this case, the HIU will return the buffer number and
buffer data for the first buffer that has its exception flag set. This allows your
host application program to receive any exceptions as they occur.
Table 2–3 describes the meaning for the different values of the MRSW. If the
macro terminated abnormally, the exception flag will be set and the
Termination Code will reflect the error. The exception flag will also be set if the
macro is explicitly disabled or the secondary device has been disconnected by a
host computer. Refer to Chapter 6 for a more detailed explanation of each
termination code.
Table 2–3 MRSW Values
MRSW Values
(hex)
Description
This macro has not been executed
since the last time it was
enabled.
The number of times a repetitive
macro response has been updated.
Termination Code – the macro is
disabled due to either an error, an
exception, or an explicit disable.
0000
0001
8000
to
7FFF
to
FFFF
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–42
USER MANUAL
2.10.6
Enabling and Disabling Macros
The ENABLE/DISABLE MACRO EXECUTION command explicitly enables
and/or disables defined macros for execution. When this command is processed
the exception flag will be cleared and the MRSW reset to 0000 hex if the macro is
being enabled, or the MRSW set to the disabled Termination Code 8001 hex if
the macro is being disabled. Macros will only be enabled when their associated
secondary device is online, otherwise, the ERROR RESPONSE will be returned
for that macro.
The adapter will return the ENABLE/DISABLE MACRO EXECUTION
command code, the Source Identification number, and a list containing a pair of
bytes for each requested buffer number. The first byte in the pair is the
requested buffer number and the second byte is the response code which
indicates whether the requested action was successful.
2.10.7
Initializing the Macro Response Buffer
There are two ways to insure that only a valid exception will set the exception
flag. The first way was shown in the DEFINE MACRO command. By setting Bit
3 in the macro options byte, the first macro response will be received, but not
compared to the contents in the macro response buffer. Thereafter, the new
responses will be compared to that first response.
The second way is to store a predefined value in the macro response buffer by
using the INITIALIZE MACRO RESPONSE BUFFER command. A useful
application is to define a macro that retrieves the status information from a
secondary device and sets the exception whenever the response is not “OK”. The
operating manual for the secondary device gives the exact Primitive response
that should be returned for a status “OK”. Preload this value into the macro
response buffer. Then, the exception flag will be set when the response is
anything other than the “OK” status that was expected.
The INITIALIZE MACRO RESPONSE BUFFER command byte string includes
the Source Identification number, the buffer number, the Primitive response
being preloaded, and an automatic enable byte. The macro must be disabled
before sending this command. The automatic enable byte can then be used to
enable the macro for execution after the response buffer is loaded without
having to issue a separate ENABLE/DISABLE MACRO EXECUTION
command.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–43
USER MANUAL
2.10.8
Checking Memory Usage
There is a certain amount of housekeeping that your host application programs
will need to do for the flexibility provided by macros. Your programs should
apply the following rules.
Your programs must assign and keep track of the Source Identification
numbers.
Your programs must ensure that no more than 32 Source Identification
numbers are active at a time. This is easily accomplished by
maintaining an internal table in your applications program. If you need
to assign another Source Id number and have already assigned 32
Source Ids, you can deallocate one number and allocate another.
However, remember that deallocating a Source Id clears all macro
buffers associated with that Source Id, so you should retrieve any
outstanding responses before deallocating.
Your programs must keep track of the buffer numbers and the
associated Source Identification number. This can also be accomplished
by maintaining an internal table in your applications program.
Your programs must ensure that no more than 254 macro buffers are
allocated.
The REPORT MEMORY USAGE command will help your programs track these
items. When your program sends Command Code 18, the UNILINK Host
Adapter will return the Command Code, the number of memory bytes available,
the number of unallocated macro buffers, the number of unallocated Source
Identification numbers, and a list of all Source Identification numbers
currently active.
2.10.9
Linking Macros
In addition to the basic operations with macros, you can also link two macros to
form a “store and forward” link between two secondary devices as illustrated in
Figure 2–19. Data types from one device will be retrieved from one secondary
and then transferred to the other secondary without any further host
intervention. The LINK MACRO command, code 1C, accepts a Source Id and
two macro command buffer numbers. Both macros must have the same Source
Id or an error will be returned. The first macro command buffer number
represents the the trigger macro. When the trigger macro is enabled and
completes processing, the second macro command buffer number or action
macro will be executed.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–44
USER MANUAL
UNILINK Host Adapter
Macro Response Buffer #A
Macro Response Buffer #B
Secondary
#1
Secondary
#2
Data Packet
Data Packet
Figure 2–19 Link Macro Store and Forward Operation
Both macros must be disabled before the LINK MACRO command will be
accepted. The trigger macro must be a valid Primitive 20 or A0 to read data from
the secondary device. The action macro must be a valid Primitive 30 or B0 to
write the data read to the other secondary. All of the define macro options on
each macro command buffer are valid until the link is established. When the
link is established, the action macro will be considered non-repetitive. When the
link is terminated the original conditions will be valid again.
The adapter will check the validity of the host supplied Primitives before
linking them. The Primitives must use the same TT type, but may use different
starting addresses (AAAA field of the Primitive). You must insure that the
number of TT types (NNNN field of Primitive) and the starting addresses are
valid for both secondaries involved.
Once the link is established, just enable the trigger macro to begin the process.
The trigger macro behaves much like a non-linked macro, except that it is
disabled while the action macro executes. Each time the trigger macro
completes a read, the trigger macro is disabled, its data moved into the action
macro buffer to create a valid write Primitive and the action macro is enabled. If
the trigger macro receives an error from the secondary, the action macro is not
enabled and the exception flag is set disabling the trigger macro.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–45
USER MANUAL
Once the action macro has successfully completed, the trigger macro behaves as
though the link never existed. If it is a repetitive macro, it will be enabled. The
trigger macro’s exception flag is also set as though the link never existed except
that it will not be set until the action macro has completed execution.
The exception flag of the action macro is only set when an error occurs for its
secondary device. If the action macro can not be executed for any reason, such as
the secondary is offline, the link will be automatically terminated. The trigger
macro will then execute as a non-linked macro. You will need to correct the
problem, then execute a recovery subroutine that will perform the following
steps.
1.
Disable the trigger macro.
2.
Reissue the LINK MACRO command.
3.
Enable the trigger macro to start executing the link again.
The link is not automatically terminated if the trigger macro fails.
2.10.10
Network Performance
You can improve the performance of your networks by adjusting the bandwidth
of the HIUs. The statistical commands will provide a picture of transaction
bottlenecks that you can also adjust. One performance measure was already
discussed in Paragraph 2.6.2.
2.10.10.1
Network Bandwidth
The Network Manager serves as the primary in a TIWAY I network. It handles
all communications between HIUs and other secondaries. It uses Network
Manager buffers to temporarily store requests and responses before they are
forwarded to the appropriate devices. These buffers are divided between the
HIUs on the network. The number of buffers assigned to a particular HIU its
bandwidth. The more buffers allocated to the HIU, the more requests the
Network Manager function can simultaneously process for that HIU.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–46
USER MANUAL
2.10.10.2
NM Buffer Allocation
These buffers are allocated implicitly with the background monitor function.
However, the NM function in an adapter in the MHIU/EHA mode does not
support background monitor or multiple hosts. The value specified for
Option–09 of the CONFIGURE NETWORK MANAGER command will be
allocated to each HIU function as the NM function brings it online. If no value
was specified for Option–09, the value will default to one fourth of the available
buffers.
An amount other that the default number of buffers can be allocated explicitly
with the ALLOCATE NETWORK MANAGER BUFFERS command when the
number of buffers allocated by the background monitor is zero or if issued before
the NM function is enabled by the CONFIGURE NETWORK MANAGER
command. The ALLOCATE NETWORK MANAGER BUFFERS command can
only be issued by the host computer attached to the adapter functioning the
Network Manager and can only be issued once for each as HIU. After the buffers
are allocated, they will remain allocated until the NM or MHIU is reset.
The adapter will return the command code and the HIU address if the
ALLOCATE NETWORK MANAGER BUFFERS command is accepted. Your
applications software can issue the REPORT NETWORK MANAGER
BUFFERS AVAILABLE command to determine how many buffers are unused.
To use it, send the one byte command, code 35. The adapter will return the
command code, the total number of NM buffers, and the number of NM buffers
available.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–47
USER MANUAL
2.10.10.3
Adjusting An HIUs Bandwidth
The REPORT NETWORK BANDWIDTH ALLOCATION command, code 36,
returns counters that reflect the relative network activity for a specific HIU.
The counters do not reset after reaching their maximum value and must be
explicitly reset.
Although the HIUs on the network have no direct control over the number of
Network Manager buffers allocated to them, they can control how those buffers
are used with the ALLOCATE HIU BANDWIDTH command. This command
defines how the buffers are to be divided between direct requests/non-repetitive
macros and repetitive macros by specifying how many of the allocated buffers
will be used for repetitive macros. By default, repetitive macros can use all of the
NM buffers allocated to the HIU. This command also limits the number of
outstanding requests for a single secondary device, preventing one secondary
from dominating the entire bandwidth. The default for this parameter is the
smaller of two requests per secondary or the number of NM buffers allocated to
the HIU. Both parameters are single bytes ranging from 00 to the number of
NM buffers allocated to the HIU. The command code will be returned if the
command is accepted. Your applications software may issue this command more
than once in order to change the parameters to match the demands as they
change.
Issue the REPORT HIU BANDWIDTH ALLOCATION command to determine
the buffer allocation and retrieve macro statistical counters. The statistical
counter parameters are long words that must be explicitly reset when they
reach their maximum values. The command string includes the command code
and the optional reset counters code.
There are two sets of counters, one for repetitive macros and the other for
non-repetitive macros. The first counter in each set counts the number of
I-Frame pairs sent and received by the macro type. The second counter in each
set counts the number of I-Frame bytes sent by the macro type. The third
counter in each set counts the number of I-Frame bytes received by the macro
type. These counts do not include any HDLC overhead or communications
counts between the NM and the HIU. Reset these counters by sending the
command string 1A 01. The adapter will return the command code 1A if
accepted.
OPERATION AND APPLICATION
UNILINK HOST ADAPTER
2–48
USER MANUAL
2.10.10.4
Performance Statistics
The REPORT NETWORK MANAGER SECONDARY STATISTICS and
REPORT NETWORK MANAGER NETWORK STATISTICS commands are
provided as network diagnostic aids for locating bottlenecks or faulty
secondaries.
The
REPORT
NETWORK
MANAGER
SECONDARY
STATISTICS command, code 37, returns statistics for a specific secondary
device. These statistics are counters reflecting the communications between the
Network Manager and the secondary.
Each transaction will update the counters until their maximum value is
reached. Then the command must be issued to reset the counters. You may want
to reset the counters before beginning the diagnostic period so that the counts
start at the zero baseline.
The second command, REPORT NETWORK MANAGER NETWORK
STATISTICS — code 38, returns statistical counters for an specific media
channel. The counts reflect the activity between the Network Manager and all
secondary addresses. Like the secondary statistics counters, these counters are
not incremented after reaching their maximum value and must be reset
explicitly with the special command sequence.
The REPORT HIU STATUS command returns the connection status of the HIU
and statistics on network performance. The statistics are counts for Network
Manager to HIU communications. The counters are not updated after reaching
their maximum value and must be explicitly reset.
UNILINK HOST ADAPTER
3–1
USER MANUAL
CHAPTER 3
CONFIGURING THE
HOST COMPUTER PORT
3.1
THE HOST COMPUTER INTERFACE
The UNILINK Host Adapter communicates with a wide range of host computer
devices through a serial binary data interface using EIA RS–232–C control
signals and EIA RS–423–A drivers as illustrated in Figure 3–1. This port is
configurable for baud rates up to 38.4K bits per second; synchronous or
asynchronous modem operation; full or half duplex; and even, odd, or no parity.
A choice of two data link protocols are available; the Non–Intelligent Terminal
Protocol (NITP) or BDLC, a byte-oriented subset of the ANSI X3.66 standard
protocol.
Host
Computer
UNILINK
RS–232–C/RS–423–A
Figure 3–1
Host Computer Interface
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–2
USER MANUAL
3.2
RS–232–C/RS–423–A PHYSICAL INTERFACE
Port 3 on the UNILINK Host Adapter, shown in Figure 3–2, is a serial
communications interface which implements a subset of RS–232–C control,
data, and timing signals using RS–423–A drivers and receivers. It is a 25-pin
female “D” connector wired as Data Terminal Equipment (DTE) for connection
to Data Communications Equipment (DCE). This connector uses the RS–232–C
Type “D” pin assignments as listed in Table 3–1. Any pins not listed should
remain vacant in order to prevent damage to the host computer or the
UNILINK Host Adapter.
A000654
Port
1
Port
2
Port
3
Port
4
AC
NEUT
AC
LINE
GND
1 2 3 4 5
I/O
Host Communications Port
Figure 3–2
Host Communications Port
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–3
USER MANUAL
Table 3–1
RS–232–C/RS–423–A “D” Connector Pin
Assignment
Interchange
Circuit
Connector
Pin No.
CCITT
Description
AA
1
101
Protective Ground
Signal Ground
Transmitted Data
Recieve Data
Request To Send
Clear To Send
Data Set Ready
Data Terminal Ready
Recieve Line SignalDetector
Transmitter Signal
Element Timing
Reciever Signal
Element Timing
102
103
104
105
106
107
108/2
109
114
115
7
2
3
4
5
6
20
8
15
17
AB
BA
BB
CA
CB
CC
CD
CF
DB
DD
Since the adapter will typically be operating in noisy industrial environments,
it is recommended that the cable length not exceed 50 feet.
3.2.1
Connection to DCE Equipment
Port 3 is configurable for synchronous or asynchronous modem operation, even,
odd, or no parity, and baud rates up to 38.4K bits per second. These parameters
are configured using the two dipswitch banks shown in Figure 3–3. The actual
settings are described in more detail in Paragraph 3.3.1.1.
LEDs
Reset
Number 2
Number 1
Figure 3–3
Dipswitch Locations
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–4
USER MANUAL
When the synchronous modem operation is selected, the adapter expects the
modem to provide the clocking signals on pins 15 (DB) and 17 (DD). Selecting
synchronous modem operation does not mean that you have selected a
synchronous data link protocol such as the bisynchronous data link protocol.
The adapter supports two asynchronous data link protocols which are described
in further in Paragraph 3.3.
3.2.2
Connection to DTE Equipment
You can also connect a host computer that has a DTE port, such as a
microcomputer, to Port 3 for asynchronous communications by using a null
modem cable. A null modem cable uses 25-pin type “D” connectors and
RS–232–C cable wired as shown in Figure 3–4. Both the adapter and the
attached host see that each is connected to a DCE device. The attaching cable
should not exceed 50 feet in length. You may order this cable from your Siemens
distributor (P/N;VPU–200–3605).
25
1
14 13
25
1
14
13
I00
Attached Device
DTE
GND
TxD
RxD
RTS
CTS
DSR
GND
DCD
GND
TxD
RxD
RTS
CTS
DSR
GND
DCD
DTR
DTR
UNILINK Host Adapter
DTE
RxCLK–No connection
TxCLK–No connection
Figure 3–4
Cable For Connecting To DTE Equipment (Null
Modem)
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–5
USER MANUAL
The IBM PC/AT
uses a 9-pin “D” connector for its serial interface port. A null
modem cable diagram for the IBM PC/AT port is shown in Figure 3–5.
6
1
9
5
14
25
1
13
GND
DTR
SD
RD
DCD
RI
CTS
RTS
DSR
TxD
RxD
RTS
CTS
DSR
GND
DCD
IBM PC/AT 9–Pin
UNILINK Host Adapter 25–Pin
Figure 3–5
IBM PC/AT 9-Pin Null Modem Cable Diagram
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–6
USER MANUAL
3.2.3
Multidrop Host Interface Circuit
You can multidrop up to 32 adapters using modems in a multipoint circuit as
shown in Figure 3–6. This allows the host computer to control multiple TIWAY I
networks; however, each adapter must use the BDLC protocol. Each adapter
must be assigned a unique address with dipswitches. The BDLC protocol uses
the addresses to route messages to the correct network. A multipoint circuit
represents the network layer of the Open Systems Interconnection model
described further in Reference 4 in the Preface and in the TIWAY I Systems
Manual (PPX:TIWAY–8101).
Host
Computer
UNILINK
Host Adapter
UNILINK
Host Adapter
UNILINK
Host Adapter
TIWAY1
Network #1
TIWAY1
Network #2
TIWAY1
Network #3
4-wire leased line
or equivalent wire
Figure 3–6
Multidrop Host Interface Circuit
NOTE
You should select half-duplex operation for the
modems when you multidrop to prevent the network
modems from simultaneously raising the carrier.
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–7
USER MANUAL
3.2.4
XON/XOFF Flow Control
XON/XOFF flow control is provided at Port 3 to accommodate host computers
with small input buffers. This is achieved with the XON and XOFF flow control
characters sent from the host computer. Transmission will stop within four
characters after XOFF is received from the host. For BDLC, the XON and XOFF
characters must be sent as the 8-bit hexadecimal characters 11 and 13,
respectively, with the eighth bit set to zero. For NITP, the XON and XOFF
characters must be sent as 7-bit ASCII characters 11 and 13 with the parity
matching the host computer parity. This flow control will operate with either
the NITP or BDLC protocols, but the adapter must be set for Full Duplex
communications by setting Position 3 of Dipswitch 2 up.
The adapter will recover from host computer failures by resetting the flow
control when the starting delimiter of the next frame is received. However, that
frame will be discarded and must be retransmitted by the host computer.
If you are using a Network Interface Unit (NIU); i.e., Ethernet, Sytek, etc., or a
host device that implements XON/XOFF flow control with the BDLC protocol,
the BDLC data values 11 and 13 hex may inadvertently trigger the flow control.
If possible, you should deselect the XON/XOFF flow control on the NIU or host
device, or select the NITP protocol on the adapter. Flow control is only provided
as a convenience for the host devices; the adapter will not try to stop a host
transmission with XOFF.
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–8
USER MANUAL
3.3
HOST PORT COMMUNICATIONS
The UNILINK Host Adapter provides a choice of two data link layer protocols
for ensuring data integrity through the physical link; the Byte–oriented Data
Link Control (BDLC) protocol and the Non–Intelligent Terminal Protocol
(NITP). Both protocols include link establishment, message framing, and error
checking functions. In addition, the BDLC protocol provides for link
disconnection and sequence control. The protocol and other host port
parameters are selected with dipswitches. Several factors are important in
deciding which protocol to use.
3.3.1
Choosing a Host Protocol
The NITP protocol was designed to be simple and still provide data integrity.
The major features of NITP are listed below.
It works in a point-to-point circuit, connecting the host computer to the
adapter. NITP cannot be used in a multipoint circuit because it does not
have the ability to address individual adapters.
Messages are transmitted in a frame that includes beginning and
ending delimiters, message character count, and a checksum.
:
Character
Count
Message
Body
ECC
;
Figure 3–7
NITP Message Structure
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–9
USER MANUAL
The host computer must wait for the adapter response for the command
issued, before another command can be issued. This command/response
sequence, illustrated in Figure 3–8, ensures that the response matches
the command.
It is designed to work with a wide range of ASCII host devices, from
ASCII terminals to intelligent workstations.
It supports a subset of the ASCII character set, “:”, “;”, “0–9”, and “A–F”.
The adapter will ignore all other ASCII characters between the ending
semicolon delimiter and the next beginning colon delimiter, so the host
computer can use these characters for routing control.
It is easier to implement than the BDLC protocol, but it is also much
slower since the data is transmitted as ASCII characters requiring two
bytes for each data value. For example, the hexadecimal value:
0E hex
/
\
becomes
30
45 (ASCII characters “0” and “E”)
More detailed specifications are given in Appendix A.
Figure 3–8
NITP Command/Response Sequence
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–10
USER MANUAL
The BDLC protocol is a byte–oriented subset of the ANSI X3.66 standard
protocol, similar to the ISO standard HDLC protocol. The major features of the
BDLC protocol are listed below.
It provides a higher level of data integrity and throughput
improvements over NITP, but it is also more complex to implement.
It uses send and receive counts in a control field for improved data
integrity.
Throughput is improved by transmitting the data as eight-bit binary
values or hexadecimal, making this protocol approximately twice as
fast as NITP. However, you will have to write and/or install the BDLC
protocol driver software on your host computer.
Additional throughput improvements are gained by using the multiple
outstanding transaction capability, illustrated in Figure 3–9. This
allows the host computer applications software to continue issuing
commands before the network response is returned. The host computer
can issue a network request to secondary device #1, then another to
secondary device #2, followed by the command to retrieve the response
from secondary device #1.
It uses an address to distinguish individual adapters in a multipoint
host interface circuit as described in Paragraph 3.2.3.
More detailed specifications are given in Appendix B.
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–11
USER MANUAL
BDLC Host Command
BDLC Host Command
RR, “Poll”
RR, “Poll”
RR, “Message Received”
RR, “Message Received”
First Network Response
Second Network Response
Host
Computer
UNILINK
Host
Adapter
Figure 3–9
BDLC Multiple Outstanding Transactions
Another consideration is that of the six configurable modes described in
Chapter 2, two of those modes emulate the original TIWAY I Host Adapter,
meaning that they require the NITP protocol. If you plan to use either the
Master Host Interface Unit (MHIU) or Host Interface Unit (HIU) in EHA mode,
you must also use the NITP protocol because these modes do not support
commands for configuring network parameters and the dipswitch used to
define the BDLC address is used to define those network parameters.
Another factor to consider is the type of secondary devices that will be on your
network. If you will be connecting Computer Interface Modules (CIM) or
Intelligent Tank Transmitters (ITT) in CIM mode, you must configure the
adapter as an MHIU/EHA which requires the NITP protocol. ITTs may also be
used in the TIWAY mode without the above restriction.
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–12
USER MANUAL
The host port communication parameters are configured with two 10-position
dipswitches located at the front of the adapter as shown in Figure 3–3. To select
NITP as the operating protocol, set position 1 of Dipswitch 1 up as shown in
Figure 3–10.
"
"
$
"$
#
" #
"
"
!$
"$
$
"$
UP DOWN
$
Figure 3–10
NITP Dipswitch Settings
NOTE
The host port parameters specify the physical layer
protocol parameters and do not imply that the data
link protocols can be either asynchronous or
synchronous. Both the BDLC and NITP protocols are
asynchronous data link layer protocols.
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–13
USER MANUAL
Next set the positions on Dipswitch 2 to correspond with the communication
parameters set for the host computer. The adapter always communicates with
the host computer using seven data bits, one start bit, and one stop bit. The baud
rate settings for Positions 5–8 of Dipswitch 2 are shown in Table 3–2.
Position 1 of Dipswitch 2 enables or disables parity bit generation and
checking.
Position 2 of Dipswitch 2 selects even or odd parity when parity
generation and checking is enabled.
Position 3 of Dipswitch 2 selects full duplex or half duplex operation.
Position 4 of Dipswitch 2 selects synchronous or asynchronous modem
communications. Selecting synchronous only enables the adapter to use
the TxCLK (DD) and RxCLK (DB) RS–232–C control signals. The
adapter will not process synchronous control characters from
synchronous data link protocols such as BiSync.
Table 3–2
Host Port Baud Rates
Dipswitch 2
Switches
Baud Rate
0
0
0
0
1
1
1
1
1
1
1
0
0
5
6
7
8
MSB
LSB
1
1
1
0
0
0
0
1
1
0
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
110
150
300
600
1200
2400
4800
9600
19200
38400
0
=
Down
1
=
Up
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–14
USER MANUAL
Position 9 on Dipswitch 2 is for selecting the adapter’s operational mode and will
be discussed in more detail in Chapter 2. Position 10 should be down for normal
operation. The other switch positions on Dipswitch 1 define the TIWAY I
network parameters and are discussed in more detail in Chapter 4.
To select the BDLC protocol as the operating protocol, set position 1 of Dipswitch
1 down as shown in Figure 3–11. With BDLC, the host port parameters are
configured with both dipswitches. Since the data is transferred as 8-bit bytes,
there is no parity bit selection.
!
"
!
"
!$!
"$!
!!!#
"!#
!
"!
!!
"!
!
!!
!!
"
!!
!!
!
UP DOWN
$
Figure 3–11
BDLC Protocol Dipswitch Settings
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–15
USER MANUAL
Table 3–3
BDLC Protocol Address
Dipswitch 1
Positions
Address
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
0
0
0
0
0
4
5
6
7
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0 = Down
1 = Up
Set the adapter’s BDLC protocol address using Table 3–3 as a guide and set the
positions on Dipswitch 2 to correspond with the communication parameters of
the host computer. The baud rate settings are shown in Table 3–2. Position 9 of
Dipswitch 2 defines the adapter’s operational mode (discussed further in
Chapter 2). Position 10 should be down for normal operation. Positions 9–10 of
Dipswitch 1 define the Host Command timeout value discussed in Paragraph
3.4.
CONFIGURING THE HOST COMPUTER PORT
UNILINK HOST ADAPTER
3–16
USER MANUAL
3.4
HOST COMMAND TIMEOUT
The Host Command Timeout is the user-selectable time period that guarantees
a response from the adapter will be returned within that limit. If the adapter
has not received a response from the secondary device before this time period
expires, the adapter will return the ERROR RESPONSE to the host computer.
This time-out function operates with either host communication protocol for the
time-out values shown in Table 3–4.
Note that a timeout value of 0 seconds signifies that the adapter will not accept
any host commands since the timeout occurs immediately. When the Host
Command Timeout is set to 0, the adapter is configured in the Standalone
Network Manager (SANM) mode.
NOTE
The adapter must be reset before any dipswitch
changes are recognized.
Table 3–4
Host Command Timeout Dipswitch Settings
Position
9
Down
Down
Up
Up
10
Down
Up
Down
Up
Description
0 sec
10 sec Timeout
20 sec Timeout
40 sec Timeout
– Accepts No
Host Commands
(SANM Mode)
DIPSWITCH 1
UNILINK HOST ADAPTER
4–1
USER MANUAL
CHAPTER 4
THE TIWAY I NETWORK PORTS
4.1
NETWORK PORTS
The UNILINK Adapter offers a choice of two physical interfaces for network
communications; the Local Line or Modem interfaces. The following table lists
the model numbers and the type of interfaces in each.
Table 4–1
UNILINK Adapter Models
Model Number
PPX:500–7111
Network Port
Dual Local Line
Dual RS–232–C/423
Dual Local Line
Dual RS–232–C/423
Supply Voltage
120 VAC
120 VAC
240 VAC
240 VAC
PPX:500–7112
PPX:500–7113
PPX:500–7114
More information on the media types can be found in the TIWAY I Systems
Manual (PPX:TIWAY–8101) and in the UNILINK Adapter Installation and
Operation Manual (PPX:TIWAY–8106).
THE TIWAY I NETWORK PORTS
4.1.1
Local Line Interface
Port 1
Port 2
Port 3
Port 4
Local Line Interface Ports
I/O
12345
Figure 4–1
Local Line Interface Ports
The Local Line interface to TIWAY I is a female 9-pin “D” connector shown as
Ports 1 and 2 in Figure 4–1. Port 1 is the primary network port. Port 2 provides
support for redundant media transmission when Ports 1 and 2 are connected to
a redundant twisted pair cable network (discussed further in Paragraph 4.2 ).
The pin assignments for these ports are given in Table 4–2.
Table 4–2
Local Line Connector Pin Assignments
Pin
1
2
3
4
5
6
7
8
9
Name
Sheild
LLM+
LLM–
Description
Reserved
Reserved
Cable shield and signal common
Reserved
Reserved
Positive biased signal line
Reserved
Reserved
Negative biased signal line
THE TIWAY I NETWORK PORTS
UNILINK HOST ADAPTER
4–3
USER MANUAL
The TIWAY I Local Line interface has the advantage of being more economical
than the modem interface since the media is shielded twisted pair cable, such as
Belden 9860 or Belden 9271. Figure 4–2 shows the TIWAY I bus structure with
the network trunkline cable, which can generally extend up to 25,000 feet with
droplines up to 100 feet in length. Figure 4–3 is a chart showing the maximum
cable distances compared to the number of stations on the TIWAY I network.
NOTE
PM550 CIM users should refer to Appendix C for
different media length factors.
Host
Computer
UNILINK
TIWAY I
UniLink Host Adapter ( MHU)
RS–232–C/RS–423–A
Host Interface Cable
Figure 4–2
TIWAY I Bus Structure
THE TIWAY I NETWORK PORTS
30
25
20
15
10
8
5
4
3
2
1
6
7
10
50
100
250
Cable Unit Loading (Number of Stations)
19.2 k bps
38.4 k bps
57.6 k bps
115.2 k bps
115.2 k bps or lower
Belden 9860
Belden 9271
Cable Distance (1000’s of feet)
20
5
I003648
Figure 4–3 Number of Local Line Secondaries vs.
Cable Distance
Signals are coupled between the transmission line and the transmit/receive
circuits to provide a level of rejection to normal AC power frequency
interference and other noise sources. Information is transferred on the TIWAY I
twisted pair media asynchronously at user selectable data rates of 110, 150, 300,
600, 1200, 2400, 4800, 9600, 19.2K, 38.4K, 57.6K, and 115.2K bits per second, in
half-duplex mode and NRZI encoding. The Local Line interface does not support
synchronous operation or NRZ.
THE TIWAY I NETWORK PORTS
UNILINK HOST ADAPTER
4–5
USER MANUAL
4.1.2
Modem Interface
A000654
Port
1
Port
2
Port
3
Port
4
AC
NEUT
AC
LINE
GND
1 2 3 4 5
I/O
Interface Ports
Figure 4–4
RS–232–C/RS–423–A Modem Interface Ports
The modem interface is a standard “Type E” DTE configuration as defined in the
EIA RS–232–C standard that uses EIA RS–423–A drivers. This interface uses a
female 25-pin “D” type connector on both Ports 1 and 2 as shown in Figure 4–4.
These two ports support redundant media transmission when connected to
redundant modem networks. The pin assignments shown in Table 4–3 are
supported. All other pins should be left vacant to prevent damage which may be
caused by non-standard pin usage.
THE TIWAY I NETWORK PORTS
Table 4–3
RS–232–C/RS–423–A “D” Connector Pin Assignment
Interchange
Circuit
Connector
Pin No.
CCITT
Description
AA
1
101
Protective Ground
Signal Ground
Transmitted Data
Receive Data
Request To Send
Clear To Send
Data Set Ready
Data Terminal Ready
Recieve Line Signal
Detector
Transmitter Signal
Element Timing
Reciever Signal
Element Timing
102
103
104
105
106
107
108/2
109
114
115
7
2
3
4
5
6
20
8
15
17
AB
BA
BB
CA
CB
CC
CD
CF
DB
DD
The line drivers and receivers meet the requirements for the RS–423–A and
RS–232–C standards. The modem interface is user–selected for either
asynchronous or synchronous operation at data rates of 110, 150, 300, 600,
1200, 2400, 4800, 9600, 19.2K, 38.4K, 57.6K, and 115.2K bits per second.
Modem interface circuits can be longer than the 25,000 feet limit of the Local
Line interface. This interface must be used for cross-building or cross-town
circuits. The modems used must be non-intelligent and have data transparency.
Non-intelligent refers to the class of modems that do not have an internal
command set. Modems such as the Hayes Smartmodem
and compatibles do
have an internal command set and should not be used. Generally, modems that
meet the Bell 103, 202, and 208 specifications will work, but the Bell 212A class
modems will not. In addition to being non-intelligent, the modems must support
data transparency which means no start bits, no stop bits, and no parity. This is
necessary because TIWAY I uses the bit-oriented HDLC protocol to transfer
information between devices. Most short haul modems are non–intelligent and
provide data transparency.
THE TIWAY I NETWORK PORTS
UNILINK HOST ADAPTER
4–7
USER MANUAL
You also have a choice of using either NRZ or NRZI encoding with the modem
interface. NRZI is recommended because of its self-clocking properties.
A special Clear-to-send (CTS) to transmit timing delay has been provided for
use with radio link modems, ranging from 0 ms to 1,000 ms in 10 ms increments.
There is also an RTS/CTS timeout. These delay values are set through
configuration commands described in Chapter 2 and Chapter 5.
4.1.3
Runaway Transmitter Recovery
The UNILINK Host Adapter is equipped with a timeout or runaway
transmitter recovery mechanism which ensures that the transmitter does not
remain turned on longer than twice the time required to send the maximum
length message. If the transmission exceeds this limit, the adapter will perform
a hardware reset, discarding all macro buffers and any outstanding directives.
NOTE
The hardware reset restores the adapter to the
initialized or power-up state. At this point, the
adapter will have to be reconfigured and the network
restored to its operating state.
THE TIWAY I NETWORK PORTS
4.2
REDUNDANT MEDIA TRANSMISSION
Most TIWAY I conformant devices support a redundant media scheme which
provides active access to a device over one of two independent media channels.
Should access to a device fail on one channel, communications can be
automatically or manually switched to the alternate channel. This type of a
circuit is illustrated in Figure 4–5. Examples of the software commands are
given in Chapter 2.
UNILINK
Drop Cables
Up to 254
Secondaries
Secondary Bus
(alternate trunk)
Bus
(main trunk)
Figure 4–5
Redundant Media Circuit
NOTE
Redundant media is provided to improve a network’s
mission reliability. However, the adapter cannot use
the dual media ports to access two independent
networks.
THE TIWAY I NETWORK PORTS
UNILINK HOST ADAPTER
4–9
USER MANUAL
4.3
TIWAY I HDLC NETWORK PROTOCOL
The TIWAY I network uses the HDLC protocol in the unbalanced, normal
response mode (UNRM) for transmission of commands and responses. In this
mode a single Network Manager (primary) controls the flow of messages
between secondary devices. Information flows between the primary and
secondaries inside HDLC I-Frames or information frames. The destination of
the frame is specified by the address field, the nature of the frame by the control
field, and any data specified by the information field. The TIWAY I primitive
requests and responses are encapsulated inside HDLC I-Frames according to
the format shown in Figure 4–6.
Flag
Address
Control
Information
FCS
Flag
Figure 4–6
HDLC Frame
THE TIWAY I NETWORK PORTS
4.4
SETTING THE NETWORK PORTS PARAMETERS
The network ports must be explicitly enabled with the CONFIGURE HIU and
CONFIGURE NETWORK MANAGER commands. The syntax for these
commands is given in Chapter 5. The network parameters specified explicitly in
these commands overrides the default values set by the dipswitches.
The choice of the host port protocol also determines whether network port
parameters can be defined on the dipswitches or through internal constants.
The BDLC protocol uses both dipswitches to define the host port parameters
and will use these internal constants for network defaults:
Local Line media —
115.2K baud,
half duplex,
asynchronous, and
NRZI
RS–232–C/RS–423–A media —
9600 baud,
full duplex,
synchronous, and
NRZ
The NITP protocol uses the values defined on Dipswitch 1 as the defaults as
shown in Figure 4–7. The network parameters are then set with Positions 2–8 of
Dipswitch 1 as illustrated in Figure 4–7. The applicable baud rate settings are
given in Table 4–4. These settings should match the settings for any other
TIWAY I network devices.
THE TIWAY I NETWORK PORTS
UNILINK HOST ADAPTER
4–11
USER MANUAL
!
!
Figure 4–7
Network Port Dipswitch Settings
NOTE
The
Local
Line
interface
will
always
be
asynchronous, half duplex, and use NRZI encoding
regardless of the setting of these dipswitches.
Table 4–4
Network Port Baud Rates
Network
0
0
0
0
1
1
1
1
1
1
1
0
0
5
6
7
8
MSB
LSB
1
1
1
0
0
0
0
1
1
0
1
1
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1
110
150
300
600
1200
2400
4800
9600
19200
38400
Baud Rate
1
1
1
1
1
1
0
1
57600
115200
0
1
= Down
= Up
UNILINK HOST ADAPTER
5–1
USER MANUAL
CHAPTER 5
HOST COMMAND SET REFERENCE
5.1
INTRODUCTION
This chapter presents the syntax for each command. The command syntax
descriptions begin in Paragraph 5.2 and are listed in numerical order (starting
at 00 to FE hexadecimal). The command syntax conventions are defined in
Paragraph 5.1.1. Certain network address values have special meanings and
are described in Paragraph 5.1.3.
Paragraph 5.8 provides a summary of the command syntax including both the
command and response syntax. Paragraph 5.9 provides a list of the command
codes and descriptions, listed in numerical order and Paragraph 5.10 provides a
similar list that groups the commands according to their use.
5.1.1
Command Syntax Conventions
Command
Code
Parameter
#1
Parameter
#2
Parameter
#n
Figure 5–1
Command String Structure
Command strings contain the one-byte command code and may include one or
more parameters as defined by each command’s syntax. All values in the
command string are in hexadecimal notation. The selected host interface
protocol, discussed in Chapter 3, will determine whether the command string is
transferred in binary format or converted to ASCII characters. The following
conventions are used to define the command syntax used in the succeeding
sections:
The most significant bit, labeled Bit 0, is the left most bit in the byte,
word, or long word.
All command code numbers are one byte, hexadecimal values and will
always be the first byte in the command string.
Each letter in a command parameter indicates a nibble (four bits) so
that a:
byte is represented as aa
word is represented as aaaa
and a long word is represented as aaaaaaaa
Parameters containing more than eight nibbles (long word) are
represented as aaaa...
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–2
USER MANUAL
All codes and parameters are separated by spaces.
Optional parameters are surrounded by parentheses, like (aa bb).
Parameter sequences that may be repeated are surrounded by
brackets, like [aa bb].
Certain letters designate a specific parameter type used throughout the
command syntax descriptions for easier identification. These are:
aa — the secondary device address.
ss — the Source Identification number.
rr — the reset counters code.
oo — the option code. Commands may have one or more
option
codes.
pppp... — a TIWAY I Primitive.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–3
USER MANUAL
5.1.2
Usage Description
A usage description is included with each command reference to give an
indication of when the command should be used. The meaning of the usage
descriptors are
CONFIGURATION
This command is used to configure the adapter
for operation. This command can only be issued
once to each adapter after they have been reset
or powered up.
INITIATION
This command is used to initialize the network
devices.
OPERATION
This command is used for ongoing
communications between the host computer
and the network devices.
PERFORMANCE
This command is used to gather statistical
performance or status information on the
adapter and the network devices, and to
redefine certain operating parameters to
improve network performance.
TERMINATION
This command is used to shut down or
terminate network devices.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–4
USER MANUAL
The cycle at power-up or reset is shown in Figure 5–2.
Configuration
Initiation
Operation
Performance
Termination
Figure 5–2 Command Usage Cycle
5.1.3
Secondary Addresses
Secondary addresses are one byte in length and range from 1 to 254. The
addresses 0 and 255 are reserved for special functions as indicated in Table 5–1.
Normally the address 255 is used as a shorthand method to indicate that the
command should be processed for all secondary devices on the network. Care
must be used with this shorthand method because a host command timeout may
occur before the response has been gathered from all of the secondaries.
Your network will operate more efficiently if you number your secondary
devices and HIUs beginning with address “1” and consecutively numbering the
remaining devices.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–5
USER MANUAL
Table 5–1 Secondary Addresses
Decimal
Address
0
1–254
255
Hexadecimal
Address
00
01–FE
FF
Usage
Reserved for special functions,
refer to individual commands.
Available for secondary device
addresses.
Reserved for special functions,
normally used to indicate all
secondary devices are to be
effected by the command.
5.1.4
Active Command Codes In Each Mode
Figure 5–3 is a decision tree illustrating the command codes that are active in
each configurable mode. In addition to mode, the command tree asks whether
the major components have been configured with their associated configuration
commands.
Power up
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO
MHIU
EHA
HIU
EHA
NM
MHIU
HIU
YES
NO
YES
NO
YES
NO
YES
NO
YES
NO
1–8, 21, FC–FF
1–8, 20–21. FC–FF
1, 2, 4–8, 21,FC–FF
20, 21,FC–FF
21, 31–38, FC–FF
21, 30–32, 34–38, FC–FF
20, 21 FC–FF
1–2, 4–10, 12–1C, 21, 30–32, 31–38, FC–FF
6–8, 10–1C, 21, 30–32, 34–38, FC–FF
6–8, 10–1C, 21, 31–38, FC–FF
6–8, 10–1C, 21, 30–32, 34–38, FC–FF
1–2, 4–10, 12–1C, 21, FC–FF
6–8, 10–1C, 21, FC–FF
20, 21, FC–FF
Intended
Mode
Adapter
Configured
(Command 20)
HIU Configured
(Command 11)
and Initialized by
Network Manager
Active
Command
Codes
Network Manager
Configured
(Command 30)
Figure 5–3 Active Command Tree
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–6
USER MANUAL
5.2
ERROR RESPONSE
An ERROR RESPONSE, rather than the normal command response, will be
returned when the host request is invalid.
Response: 00 dddd (aa)
Parameters:
dddd
Error codes. All error codes and corrective actions are given in
Chapter 6.
aa
The secondary address associated with the error code. This
parameter is only included if applicable.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–7
USER MANUAL
5.3
BASE HIU COMMANDS
The Base HIU commands are backward compatible with the original commands
for the TIWAY I Host Adapter. These commands cause a direct network request
to be issued to connect and disconnect secondaries, send data to and from
secondaries, and read secondary statistics. Your applications software must
wait for a response to be returned before issuing another command if you are
using the NITP protocol. If you are using the BDLC protocol, you can have up to
two outstanding transactions before the adapter will return the Receiver Not
Ready (RNR) BDLC control frame. These commands are listed below.
Send Network Data — 01
Broadcast Network Data — 02
Poll Secondary — 03 (Available only in MHIU/EHA mode)
Connect Secondaries — 04
Disconnect Secondaries — 05
Read Secondary Log — 06
Read Secondary Diagnostics — 07
Read Adapter Diagnostics — 08
These commands will not be accepted by either the hosted or the stand-alone
Network Manager modes.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–8
USER MANUAL
5.3.1
Send Network Data — 01
The SEND NETWORK DATA command sends a specified host Primitive to a
network secondary via the Network Manager. Once the Primitive has been
received by the secondary, the Network Manager polls the secondary for the
Primitive response and returns it to the issuing HIU. The HIU then forwards
the Primitive response to the attached host computer.
Command:
01 aa pppp...
Response:
01 aa pppp...
Usage:
OPERATION
Modes:
MHIU/EHA, HIU/EHA, MHIU, HIU
Parameters:
aa
The secondary address to receive the Primitive data.
pppp
The TIWAY I Primitive data (command or response). This
parameter begins with the length field of the Primitive.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–9
USER MANUAL
5.3.2
Broadcast Network Data Transfer — 02
The BROADCAST NETWORK DATA TRANSFER command sends the
Primitive data to all online secondary devices. The secondary device log
contains only those secondary devices in the network that are online. However,
this type of information transfer does not use the full TIWAY I HDLC integrity
checks to ensure message delivery.
If the adapter is configured as an MHIU in EHA mode, the host applications
software must issue a POLL command for each secondary device to collect the
responses or some responses may be lost. In any other configuration, you should
include a data element that is set in the secondary with the broadcast and
checked by the host applications software by sending a SEND NETWORK
DATA command to determine if the broadcast message was received. The data
element can also be checked by the secondary devices program to cause it to
perform a programmed process. This function can be more efficiently handled
in non-MHIU/EHA networks by using macros for data acquisition.
NOTE
Before the data is broadcast, all pending TIWAY I
I–Frames from all HIUs will be processed. Then no
further directives will be processed until the
broadcast completes. This could have a serious
impact on the response time for normal network
operations and should be used carefully.
The following are typical uses for this command.
Time synchronization for all secondary devices. This could be used to
signal all secondaries to reset their counters at the beginning of a
production period.
Data collection via a snapshot read. The broadcast could signal the
secondaries to move data to a designated area in the secondary device
which will be retrieved later with a POLL or SEND NETWORK DATA
command.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–10
USER MANUAL
CAUTION
You
should
not
issue
the
BROADCAST
NETWORK DATA TRANSFER command if your
network
contains
Intelligent
Tank
Transmitters (ITTs) as secondary devices, or
you could lose responses. Also, sending a
BROADCAST NETWORK DATA TRANSFER
command when your adapter is configured as
either an MHIU or an HIU will cause a network
HDLC error to be logged even though the
information was received. This error will be
included in the statistics from the READ
SECONDARY DIAGNOSTICS, REPORT HIU
STATUS, REPORT NETWORK MANAGER
SECONDARY STATISTICS and the REPORT
NETWORK
MANAGER
NETWORK
STATISTICS commands.
Command: 02 pppp...
Response: 02
Usage: OPERATION
Modes: MHIU/EHA, HIU/EHA, MHIU, HIU
Parameters:
pppp
The TIWAY I Primitive request. This parameter begins with the
length field of the Primitive.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–11
USER MANUAL
5.3.3
Poll Secondary — 03
The POLL SECONDARY command is issued to collect the responses to the
broadcast command or a SEND NETWORK DATA command that timed out in
the Network Manager (NM). This command is only valid for an adapter
configured as an MHIU in EHA mode.
Command: 03 aa
Response: 03 aa pppp...
Usage: OPERATION
Modes: MHIU/EHA
Parameters:
aa
The secondary address being polled.
pppp
The TIWAY I Primitive data response. This parameter begins
with the length field of the Primitive.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–12
USER MANUAL
5.3.4
Connect Secondaries — 04
The CONNECT SECONDARIES command logically connects one or more
secondaries to the network. Each host computer must issue this command for
the secondary devices that it will be communicating with.
Trying to connect many secondary devices at the same time could cause the host
command time-out to expire if the secondary devices do not respond in that time
limit. If this occurs, the error response will be returned and the host computer
will have to retrieve the secondary log to determine which secondary devices
were connected.
Command: 04 [aa]
Response: 04 [bb]
Usage: INITIATION
Modes: MHIU/EHA, HIU/EHA, MHIU, HIU
Parameters:
aa
The secondary addresses to be connected. Specifying address FF
will attempt to connect all secondaries.
bb
The secondary addresses that connected properly. If bb is 00 hex,
none of the secondaries addressed were connected.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–13
USER MANUAL
5.3.5
Disconnect Secondaries — 05
The DISCONNECT SECONDARIES command removes the specified
secondaries from the secondary log and automatically disables associated
macros, setting their MRSWs to the appropriate Termination Code. If the HIU
processing this command was given permission to issue a DISC on the network
when it was initialized, then this command also issues a DISC directive that
logically disconnects (possibly causing the secondary device to perform a
hardware reset) the specified secondary from the network. This does not
prevent another HIU or the background monitor from reconnecting the
secondary. Once a secondary device is logically disconnected, it will appear
offline to all HIUs on the network, causing the remaining network HIUs to set
the exception flag and MRSWs for any macros associated with that secondary.
Trying to disconnect many secondary devices at the same time, using the global
address FF hex, could cause the host command timeout to expire if the
secondary devices cannot respond in that time limit. If this occurs, the ERROR
RESPONSE will be returned and your applications software should retrieve the
secondary log to determine which secondary devices were disconnected.
Command: 05 [aa]
Response: 05 [bb]
Usage: TERMINATION
Modes: MHIU/EHA, HIU/EHA, MHIU, HIU
Parameters:
aa
The secondary addresses to be disconnected. Specifying address
FF will attempt to disconnect all secondary devices listed in the
secondary log.
bb
The secondary addresses that disconnected properly. If bb is 00
hex, none of the secondaries addressed were disconnected.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–14
USER MANUAL
5.3.6
Read Secondary Log — 06
The READ SECONDARY LOG command returns the list of secondaries that
are logically connected to the HIU.
Command: 06
Response: 06 [aa]
Usage: OPERATION
Modes: MHIU/EHA, HIU/EHA, MHIU, HIU
Parameters:
aa
The secondary addresses currently connected to the HIU. If no
secondaries are connected, the value returned will be 00.
HOST COMMAND SET REFERENCE
UNILINK HOST ADAPTER
5–15
USER MANUAL
5.3.7
Read Secondary Diagnostics — 07
The READ SECONDARY DIAGNOSTICS command returns statistics for the
specified secondary device. Only counts related to the issuing HIU are
returned. With the exception of the number of I–Frames transmitted to and
from the secondary, these counters do not represent an exact count of events
and are intended only to show trends that may indicate problems. The counters
will not be updated for offline secondaries or after reaching their maximum
value of FFFF. The host computer must explicitly reset the counters by issuing
this command with the reset counter code.
Command: 07 aa (rr)
Response: 07 aa (bbbb cccc dddd eeee ffff gggg hhhh iiii)
Usage: PERFORMANCE
Modes: MHIU/EHA, HIU/EHA, MHIU, HIU
Parameters:
aa
The secondary address. If the special address FF is used and the
reset code parameter is set to 01, the statistics counters for all
secondaries will be reset. The special address cannot be used to
return the statistics counters for all secondaries simultaneously.
rr
The reset statistics counters code. This optional parameter was
added to the original TIWAY I Host Adapter command to allow
the counters to be reset.
00 = Return the statistics counters for the specified secondary,
but do not reset the counters.
01 = Reset the statistics counters for the specified secondary and
do not return any counts. Only the address field is returned with
the command code when this option is selected.
bbbb
The number of polls successfully transmitted to the secondary.
cccc
The number of TIWAY I HDLC I–Frames successfully
transmitted to the secondary.
dddd
The number of network errors including CRC errors, timeouts,
aborts, and the loss of RS–232–C/RS–423–A control signals.
eeee
The number of TIWAY I HDLC I–Frames received.
ffff
This value will always be zero.
gggg
The number of TIWAY I HDLC errors, including command
rejects (FRMR), invalid HDLC responses, and sequence errors.
This number may reflect errors logged because a BROADCAST
NETWORK DATA TRANSFER command was issued in a
network that contains Intelligent Tank Transmitters (ITTs) as
secondary devices. These errors are logged because the ITT
returned a REJ even though the information was received.