
.LAYOUT 0
.PS 60,70
.RM 70
.AUTOPARAGRAPH
.ENABLE INDEXING
.ENABLE TOC
.SET PARAGRAPH 0,1,2
.SPACING 1
.FLAGS INDEX
.FLAGS SUBINDEX
.XLOWER
.FLAGS UNDERLINE
.NO FLAGS HYPHENATE
.FLAGS COMMENT
.NO FLAGS ACCEPT
.FLAGS ACCEPT `
.DATE
.ST 
.TITLE Manufacturing Automation RSX Queueing/Routing
.ch INTRODUCTION
	This Document explains the  RSX11M-Plus version of the 
Manufacturing Automation Queueing and Routing software.  The 
reader should also be familiar with the VAX/VMS version.
.hl 1 QUEUEING OVERVIEW
	The same functions that are available from the VAX/VMS
Queueing software (herein called Queue Services)  are also available 
from the RSX Queueing software.  The
way in which the Queue is managed and accessed are different between
the two operating system environments.
.x MA_ROUTER Process>Referenced
.hl 1 ROUTING OVERVIEW
	The RSX router provides the same functions as the 
MA_ROUTER running on a VAX/VMS node.  Specifically,
the RSX router performs the following functions:
.list
.le;Guaranteed delivery of messages removed from the host RSX Queue
and transmitted to a remote DECNET node which supports the MA_ROUTER
protocol.
.le;Guaranteed reception and queueing of messages received from
a remote DECNET node which supports the MA_ROUTER protocol.
.le;Automatic link reestablishment.
.le;Multiple links by a single router.
.els
.hl 1 QUEUEING COMPONENTS
	The following RSX tasks support message queueing on an RSX node:
.list 1,'o'
.x ZQ Driver>Overview
.le;ZQDRV -- This is a pseudo device driver that provides the interface
between the application tasks and the ACP that performs all queueing
functions.  The applications simply issue queueing requests (write to
Queue, read from Queue, etc.) to ZQ0: via the QIO directive and wait
for the requests to be processed by the ACP.
.x QUEACP Task>Overview
.x MAQUEUE.DAT File>Referenced
.le;QUEACP -- This is the queueing ACP that processes all valid Queue
requests received from the application tasks via the ZQ driver.  This
is the only task that accesses the Queue (file MAQUEUE.DAT).
.x QMT Task>Overview
.x QUEUEIDS.DAT File>Referenced
.le;QMT -- This task maintains the Queue (file MAQUEUE.DAT) and the
message ids (file QUEUEIDS.DAT).
.x TSTACP Task>Overview
.LE;TSTACP -- This task can be used to test all queueing functions
available through the ZQ driver and the ACP.
.els
.hl 1 ROUTING COMPONENTS
	The following RSX tasks support message routing on an RSX node:
.list 1,'o'
.x RTRRSX Task>Overview
.x MA_ROUTER Process>Referenced
.le;RTRRSX -- This task is responsible for sending messages 
to another node supporting either the RSX
router (this task) or the VMS router (Process MA_ROUTER).  It is also 
responsible for receiving any messages sent from another node.
All communication with another node is provided by the standard
DECnet RSX system directives.  All routing information is 
stored in a routing database.  This database is an installed
common region named RTRDBS.
.X RTRDBS Routing Database>Referenced
.x FNDSRV Task>Overview
.le;FNDSRV -- This task translates a logical node name into
an actual node name.  The task is requested to run by the routing
task RTRRSX whenever the node the router is attempting to
connect to is flagged as a logical node.  It will supply the routing
task with the actual name of the node so that the routing task
will be able to make a connection.
.x NRBDMP Task>Overview
.LE;NRBDMP -- This task displays information contained in the routing
database.  It will display which nodes are currently connected to
the routing task RTRRSX (i.e. logical links established with
routers on remotes nodes) and which message ids are destined
to the remote nodes.
.els
.hl 1 DOCUMENTATION GENERATION
	This manual exists in the file MARSXQ.LIS.  It is generated
from the Runoff file MARSXQ.RNO using Runoff commands in the command
file MARSXQ.CMD.  Since the Runoff task used is the DSR (Digital Standard
Runoff) available only on a VAX/VMS system, the following must be 
done to update and regenerate this document:
.list 
.le;Copy MARSXQ.RNO to MA_RSX_QUEUE.RNO on the VMS system.
.le;Copy MARSXQ.COM to MA_RSX_QUEUE.COM on the VMS system.
.LE;Edit MA_RSX_QUEUE.RNO.
.le;Issue the command @MA_RSX_QUEUE to create the list file MA_RSX_QUEUE.LIS.
.ELS
.ch QUEUE FUNCTIONS
	The Queue in the RSX environment exists on the disk as a 
contiguous disk file that is multi-threaded (one thread for each
message id).  
The Queue is divided into four major parts:
.list
.le;The Queue header.
.le;The message id headers.
.le;The Queue message block bitmap.
.le;The actual Queue message blocks.
.els
All messages are written to a message id subqueue pointed to
by a message id header.  A message id header points to the
first message in a message id subqueue, the first message 
points to the second message in the message id subqueue, etc.
If there are no messages in a message id subqueue, the 
message id header pointers are zero.
	The creation of the Queue itself and the maintenance
of the Queue is done by the Queue Maintenance Task (QMT).  The
.x QMT Task>Referenced
Queueing software does not support the addition, modification,
or deletion of message ids without the creation of a new Queue.
(This may involve a bootstrap as the most convenient method of 
installation.)
	The access to the Queue is via the ZQ device driver,
.x ZQ Driver>Referenced
Queue access subroutines (these allow easy application program
interfaces but are not mandatory), Queue ACP "QUEACP", and the normal disk
driver for the disk volume on which the Queue is installed.
.x QUEACP Task>Referenced

.hl 1 QUEUE PHYSICAL FLOW
	Figure one shows an overview of the queueing functions.  The
QUEACP ONLY uses the file system to open the Queue file to get the
starting and ending logical blocks of the file; from
then on it uses only the disk driver.  The ACP also reads the header
of the Queue into memory, region QUEHED, for faster access and only
writes the header back to disk after certain queueing functions have been
completed.
.x QUEHED Region>Defined
The following  narrative
explains the simple write and read to the Queue.
	For either the write or the read, the application must
assign a Logical Unit Number to the ZQ device.   
	For the READ function, the following are the steps
required:
.list
.le;Call INITQ subroutine to set up the exit handlers for
any message id that may be connected.
.x INITQ Subroutine>Referenced
.le;Call ATCHQ subroutine to attach for a read on the specified message
id (multiple calls are required if more than a single message id
will be dequeued by this task).
.x ATCHQ Subroutine>Referenced
.le;CALL READQ subroutine (assuming that there was a message to be dequeued)
to read the desired message id message.
.x READQ Subroutine>Referenced
.le;Process the message.
.le;CALL ACKQ subroutine to acknowledge the message.  This will delete the
message completely from the Queue.
.x ACKQ Subroutine>Referenced
.le;CALL DISCQ subroutine when complete to cancel all connected message ids.
.x DISCQ Subroutine>Referenced
.els
	For the WRITE function, the task need only call the
WRITEQ subroutine to write the message to the Queue.
.x WRITEQ Subroutine>Referenced
.hl 1 ACP/DRIVER CONTROL
	The Queue was implemented as a device driver and as an ACP
such that no address space would be used by the queueing functions.
The job of the ZQ device driver is simply to provide
address relocation, a  FIFO queue by priority, and a standard
interface required by the RSX executive.
.X ZQ Driver>Referenced
.hl 2 DRIVER I/O LIST
	Each I/O packet is interpreted prior to being queued to the
device driver I/O list (S.LHD of the SCB).  The driver will 
forward all valid packets immediately to the ACP if it is mounted
or if the command is a mount command.   If the command is the
IO.DAC command (issued by calling queueing routine INITQ), the I/O packet 
is threaded to the device driver; however, it will never be dequeued 
unless the task
either exits or does IO.KIL to the device driver (by calling queueing
routine DISCQ).  When this happens,
the request is forwarded to the ACP as a special packet
(simply a buffer acquired from primary pool that is the same size, etc. as
a normal I/O packet); however,
the actual requested I/O packet will be processed by the ACP before the ACP
processes the special I/O packet.
.hl 1 QUEUEING FUNCTIONS
	The QUEACP provides the following functions via the
.x QUEACP Task>Defined
ZQ device driver when the ACP is mounted.
.list
.le;IO.WVB- This function is called to write a message to a
message id subqueue.  The message id and the message are passed
to the function.
The type of the message is also specified for
recovery actions in the event the subqueue for the specified message id
is full.
.le;IO.WVB+1- This function is the same as IO.WVB, but is only used by the 
.x RTRRSX Task>Referenced
routing task, RTRRSX, to bypass writing a new header when the message 
is received from the remote node.
.le;IO.RVB- This function is called to read the first message in a message
id subqueue.  The message id and the message buffer are passed to 
the function.  The second word of the 
I/O status block will contain a "read but not acknowledged
identifier" which must be used to acknowledge the message
in the Queue.  The size of the message can be determined by
the header portion of the message.
.le;IO.ACR- This function allows any task to request
notification whenever messages are received for the specified
message id.  The ACP will determine if the task is able to 
accept the notification prior to doing the notification (i.e. the
task is still in the system and part of the system task directory).
The connected task will be notified by setting the task's event flag.
.le;IO.ACW- This function is used in conjunction with
the IO.RVB so that a task that just read and processed a message
can also acknowledge the message.  Acknowledging a message causes
the message to be deleted.
.LE;IO.RNA- This function will place the read but not acknowledged message 
back at the beginning
of the specified message id subqueue.
.le;IO.DEL- This function allows the user to delete without
acknowledging a passed number of messages from the desired message id subqueue.
.le;IO.RAT- This function allows the user to receive the
current status of the desired message id subqueue.
.le;IO.ACE- This function allows the user to receive the
current status of the Queue (read Queue header).
.le;IO.APC+1- This function mounts the pseudo device ZQ with 
the ACP.  
.LE;IO.APC+2- This function dismounts the pseudo device ZQ from the 
ACP.
.LE;IO.DAC- This function provides, via I/O rundown, exit handling in the event
a task exits or is aborted.
.els
.ch QUEUE MAINTENANCE TASK
.x MAQUEUE.DAT File>Referenced
.x QUEUEIDS.DAT File>Referenced
	The task QMT provides the ability to add, modify, and delete
message ids to/from the message id file QUEUEIDS.DAT.   The task
also provides the ability to maintain the Queue file MAQUEUE.DAT and
to mount and dismount the ACP to/from the ZQ device driver.
The task is installed 
as an MCR command task, i.e. all commands are sent via the MCR command
line.
.x QMT Task>Defined
	The following gives the list of functions available.
.LIST 1,' '
.LE;List the message ids in the Queue and the 
parameters associated with the current Queue file.
Note: This only lists those ids that will be placed into
the Queue on the next Queue creation and possibly not
those that are currently in service.
	MCR`> QMT/LI
.LE;Create a new Queue file with the message ids
from the message id file and with a size of nnnn message
blocks.
 	MCR`> QMT/CR:nnnn
.LE;Reset all pointers and clean up the current Queue
file (will basically deallocate all message blocks
and reset all message id list heads).  Note: Dismount the ACP
from the device ZQ0: before performing the reset.
	MCR`>QMT/RE
.LE;Add a new message id to the message id file.
	MCR`>QMT/IN/ID:<--16 character message id`>/MX:<max number of messages`>
.LE;Update the maximum number of messages that are permitted in the message id
subqueue in the message id file.
	MCR`>QMT/UP/ID:<--16 character message id`>/MX:<max number of messages`>
.LE;Delete a message id from the message id file.
	MCR`>QMT/DE/ID:<--16 character message id`>
.LE;Delete messages from the message id subqueue.  The ACP
must be mounted to device ZQ0:
	MCR`>QMT/DL/ID:<--16 character message id`>/MX:<max number of messages`>
.LE;Perform a consistency check on the Queue file (will basically traverse
the message links in each message id subqueue and free all blocks that are 
marked as used but are not linked in any subqueue).  Notes: Dismount the ACP
from the device ZQ0: before performing this check.  Some link errors will
result in an entire reset of the Queue file.
	MCR`>QMT/CON
.LE;Mount the ACP to device ZQ0:
	MCR`>QMT/MOU
.LE;Dismount the ACP from the device ZQ0:
	MCR`>QMT/DMO
.le;Display the message id listhead for the specified message id.  The ACP
must be mounted to device ZQ0:
	MCR`>QMT/DID/ID:<message id`>
.le;Display the Queue header.  The ACP must be mounted to device
ZQ0:
	MCR`>QMT/DQH
.ELS
.hl 1 FILES REQUIRED
.x MAQUEUE.DAT File>Defined
.x QUEUEIDS.DAT File>Defined
	The QMT task keeps a keyed file (QU0:QUEUEIDS.DAT) of all the message 
ids that are to be queued in the final Queue.  Associated with
the message ids is the number of messages allowed in each 
message id subqueue.  This file is then used along
with the command line supplied for the create function to
generate the final Queue file: "QU0:MAQUEUE.DAT".  Note:
the pseudo device name QU0: selects the disk drive
that is to contain the Queue.
.CH ROUTING TASK
	The routing task, RTRRSX, is the task that implements
.x RTRRSX Task>Defined
.x MA_ROUTER Process>Referenced
the MA_ROUTER protocol and guarantees the placement of a message
from one Queue on one node to another Queue on a second node.
Figure two provides an overview diagram of how the router
communicates with other DECNET remote nodes.
.hl 1 ROUTING SPECIFICS
	In an overview, this task acts like any other task reading from
the Queue in that it must read and then acknowledge any messages read.
The read is performed when the router has successfully connected
with the target node of the message and the router has sufficient
buffers (a managed resource within the RTRRSX task and the 
routing database, RTRDBS).  The acknowledge is done when the router on
.x RTRDBS Routing Database>Referenced
the remote node has successfully placed the message on to its
Queue and has responded with a successful status back to the router
on the source node.
	In the event that
the remote node fails to respond (link failure), the remote
node has no room for the message in its Queue, or the remote
node does not know of the message id, then the router calls the
queue services  to place the message back onto the front of the 
message id subqueue.
The router will not attempt to dequeue another of the same 
message id until a selectable timer expires (one hour typically).
	As a writer, this process writes to the Queue via a
special entry which does not destroy some of the header 
information that is part of each message that is in the Queue.  This
is because this information was placed into the header by the
queue services on the remote node and is to be preserved (such
as the "On Queue Time" and the "Sending Node Name").
	If any task in the system needs to be notified when a node
connects/disconnects, the message id NET_STATUS should be added to
the Queue.  The router will then write a connect/disconnect message
to the Queue every time a connect/disconnect occurs.  Another task
(not included) can read the connect/disconnect messages and inform
the tasks that need to know about any connect/disconnect.  See the
STADEF macro in Appendix A for the form of the connect/disconnect
message.
.hl 2 SPEED ENHANCEMENTS
	To allow the router to quickly determine if a particular
node has messages available for routing, the router maps the
QUEHED region.  The router then simply scans the messages for a
particular node based on the following criteria:
.x QUEHED Region>Referenced
.list
.le;The router has free buffers for output.
.le;There is a logical link available to the target node.
.le;There is not an outstanding Read but Not acknowledged message.
.le;The message id is not marked non-routable (see above).
.els
.TP 40
.HL 1 ROUTING DATABASE
	The generation of the routing database, RTRDBS, should be done
.x RTRDBS Routing Database>Defined
.x MA_ROUTER Process>Referenced
via the VAX routing database management utility (see the
VAX/VMS MA_ROUTER guide).  However, the following example
gives a typical listing of a routing database.  NOTE: The parameters
passed to a macro must all be on the same line.  The form used below
is for printing purposes only.
.NOFILL
;
; ROUTING DATABASE
;
	.INCLUDE	/RTRDEF.MAC/
	.LIST MEB
	
	RTRDEF
	
	NODE	PRI=<B4750A`>,SIZ=1024.,ACC=<<MA_ROUTER`>`>
	ROUTE
	
	NODE 	PRI=<B4750B`>,SIZ=1024.,ACC=<<MA_ROUTER`>`>
	ROUTE
	
	NODE 	PRI=<PA750A`>,SIZ=1024.,ACC=<<MA_ROUTER`>`>
	ROUTE	ID=<MICHIGAN`>
	ROUTE
	
	NODE	LOG,PRI=<PRODUC`>,SIZ=1024.,ACC=<<MA_ROUTER`>`>
	ROUTE
	
	NODE 	PRI=<B4073B`>,SIZ=1024.,
		ACC=<<RTRRSX`>,DECNET,<'D,'E,'C,'N,'E,'T=`>`>
	ROUTE	ID=<DAVE`>
	ROUTE	ID=<EARL`>
	ROUTE
	
	NODE
	
	.END
.FILL
	After the database is built and installed, Program NRBDMP can be
used to display the contents of the database.
.X NRBDMP Task>Defined
	The following gives all of the parameters for each of the macros 
used above, (RTRDEF,NODE, and ROUTE).
.hl 2 RTRDEF
.X RTRDEF Macro>Defined
.list 1 ' '
.le;MXSZ -- Largest outbound message size in bytes.  If not present, the 
default size is 512. bytes.
.le;MXOT -- Number of output (outbound message) buffers.  If not present,
the default number of output buffers is 4.
.le;MXRS -- Number of response message buffers.  If not present, the default
number of response buffers is MXOT*2.
.els
.nofill
Example:
	
	RTRDEF	MXSZ=1024.,MXOT=6.,MXRS=10.
.FILL
.HL 2 NODE
.X NODE Macro>Defined
.list 1 ' '
.le;LOG -- Primary node name is a logical node name flag.  If present, the
node name specified in the PRI parameter is not an actual node name but
a logical node name that must be translated.
.le;PRI -- Name of the primary node.  If not present, the list of NRB's (node
routing blocks) in the database is terminated; there is no default primary
node.  If the LOG parameter is present, this name is a logical node name.
.le;SEC -- Name of the secondary node.  If not present, the default secondary
node is the primary node specified by the PRI parameter.  If the LOG parameter
is present, the secondary node name will be blank until the logical node name
specified in the PRI parameter is translated into an actual node name by task
FNDSRV (run by the Router).
.x FNDSRV Task>Defined
.x MA_ROUTER Process>Referenced
.le;ACC -- Access control string.  If not present, the default access control
string is <MA_ROUTER`>.
.le;SIZ -- Size of the input buffer (in bytes) that receives the 
messages from the node specified in the PRI parameter.  If not present, the
default size is 512. bytes.
.els
.nofill
Examples:
	
	NODE	PRI=<B4750A`>,SEC=<B4750B`>,
		ACC=<<MA_ROUTER`>`>,SIZ=1024.
	
	NODE	LOG,PRI=<PRODUC`>,
		ACC=<<MA_ROUTER`>`>,SIZ=512.
.FILL
.HL 2 ROUTE
.X ROUTE Macro>Defined
.list 1 ' '
.le;ID -- Name of a message id in the Queue that will have its messages routed
to a remote node.  If not present, the message id list of an NRB in the
the database is terminated; there is no default message id.
.els
.nofill
Example:
	
	ROUTE	ID=<MESSAGE_ID`>
.FILL
.CH ZQDRV
.x ZQ Driver>Defined
	The Pseudo device driver ZQ allows all requests to
be queued in a FIFO and priority manner to the ACP.  The
application coder will normally not access the driver
directly but rather via the queue subroutines (see QUEUE SUBROUTINES
chapter).  
.NOFILL
  
THE QIO CALL IS:
      QIO$    FNC,LUN,EFN,PRI,ISB,AST,<P1,P2,P3,P4,P5,P6`>
.SK
WHERE:
	FNC= Function
	LUN= Lun assigned to ZQ0:
	EFN= Event flag used for I/O sync 
             (should be nonzero)
	ISB= I/O STATUS block
	AST= AST subroutine address
	P1 to P6= Device and function specific 
             Parameters
.fill
	The valid function codes are:
.LIST
.tp 10
.le;IO.WVB- Write a message to a specified message id subqueue.
.list
.le;P1= Message buffer address.
.le;P2= Byte count of user message.
.le;P3= Address of message id buffer (16 bytes long).
.le;P4= Destroyed when id buffer relocated.
.le;P5= Type of message (0= deletable if queue is full, 1= not deletable).
.els
.tp 10
.le;IO.WVB+1- Same as IO.WVB, but only used by the routing task, RTRRSX,
.x RTRRSX Task>Referenced
to bypass writing a new header when the message is received from the remote 
node.
.tp 10
.le;IO.RVB- Read a message from a specified message id subqueue.
.list
.le;P1= Message buffer address.
.le;P2= Byte count of user buffer to receive message.
.le;P3= Address of message id buffer (16 bytes long).
.els
.tp 10
.le;IO.ACR- Connect a message id subqueue to a task.
.list
.le;P1= Address of message id buffer (16 bytes long).
.le;P2= 16.
.le;P3= Event flag to set when the number of messages in the 
subqueue goes from zero to one.
.els
.tp 10
.le;IO.ACW- Acknowledge a message read from a message id subqueue.
.list
.le;P1= Address of message id buffer (16 bytes long).
.le;p2= 16.
.le;P3= Internal ID. (This id was returned when a read 
occurred in the upper byte of the I/O status word. It 
is a sequential number that is simply checked as a 
sequence number.)
.els
.tp 6
.le;IO.RNA- Replace read but not acknowledged message back at
beginning of the message id subqueue.
.list
.le;P1= Address of message id buffer (16 bytes long).
.le;P2= 16.
.els
.tp 6
.le;IO.DEL- Delete a specified number of messages without acknowledging 
from a message id subqueue.
.list
.le;P1= Address of message id buffer (16 bytes long).
.le;p2= 16.
.le;P3= Number of messages to be deleted.
.els
.tp 6
.le;IO.RAT- Read message id subqueue list head.
.list
.le;P1= Buffer address to receive list head (see MIDDEF).
.le;P2= Byte count of user buffer.
.LE;P3= Address of message id buffer (16 bytes long).
.els
.tp 6
.le;IO.ACE- Read the Queue header.
.list
.le;P1= Buffer address to receive Queue header (see QHDDEF).
.le;P2= Byte count of user buffer.
.els
.tp 3
.le;IO.APC- Mount/dismount the desired pseudo device unit with 
the ACP (IO.APC!1= Mount, IO.APC!2= Dismount).
.tp 5
.le;IO.DAC- Set up exit handling I/O rundown function.  This
I/O never completes.  The ACP is called with a new packet
when a task exits so that any message ids connected to the exiting
task are disconnected.  This function must be called prior to
any calls to connect to a message id.
.le;IO.KIL- Standard device functioning.
.le;IO.ATT- Standard device functioning.
.le;IO.DET- Standard device functioning.
.els
.FILL
.SK
	Possible I/O Status error codes:
.LIST 1,' '
.le;IE.IFC (-02) -- Invalid function code.
.x IE.IFC>Referenced
.le;IE.SPC (-06) -- Bad buffer address.
.x IE.SPC>Referenced
.le;IE.DNA (-07) -- ZQ: device not mounted.
.X IE.DNA>Referenced
.le;IE.WLK (-12) -- A connect request has been received from a task that
does not have a pending I/O.  Subroutine INITQ was probably not called
to set up the task exit handlers.
.x INITQ Subroutine>Referenced
.X IE.WLK>Referenced
.le;IE.LCK (-27) -- Trying to mount ZQ: device when already mounted; trying
to dismount ZQ: device when already dismounted.
.x IE.LCK>Referenced
.le;IE.ILL (-42) -- The ACP is not installed in the system.
.x IE.ILL>Referenced
.le;IE.NFW (-69) -- ACP not found in system task directory when trying to
mount ZQ: device.
.x IE.NFW>Referenced
.le;IE.IQU (-91) -- Trying to mount ZQ: device with a task that is not 
marked as an ACP.
.x IE.IQU>Referenced
.els
.CH QUEUE SUBROUTINES
	The following subroutines are written in MACRO#11 and
are supplied such that the application programmer need not
do QIO's directly to the ZQ device driver.   The user is
strongly suggested to use the subroutines as any changes in
the functioning of the ZQ device driver and the ACP will
be supported by these subroutines only.
	These subroutines support the I and D space 
available under RSX11M-Plus, however, they are not
shareable and not reentrant.
.x ZQ Driver>Referenced
.PAGE
.HL 1 ACKQ.MAC
 
.c ;MODULE
.c ;^&ACKQ\&
.HL 2ACKQ                
.nf
.x ACKQ Subroutine>Defined
Source: ACKQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
                              TO ZQ0:
    
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR I/O 
                              SYNC
   
   MSGID                      CHARACTER*16  (BYTE(16))
                              MESSAGE ID OF LIST HEAD TO 
                              READ
  
   RNA                        INTEGER*2
                              READ NOT ACKNOWLEDGED POINTER
                              (RETURNED FROM ACP/DRIVER IN 
                              I/O STATUS BLOCK)
  
Returns:
 
   ACKQ                       INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
                              OF THE CONNECT
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows a task to acknowledge the reading of
a message in a message id queue in the Manufacturing Automation Queue.  
The return status is returned as the value of the function subroutine.  The
calling sequence is:
.sk
.tp 40
.nofill
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 RNA	     ! READ BUT NOT ACKNOWLEDGED 
                             ! POINTER
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	MSGID='DUMMY ID'  ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C ACKNOWLEDGE THE READ
C
	STATUS=ACKQ(LUN,IEFN,MSGID,RNA)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,
	1	' BAD QUEUE STATUS ON MESSAGE ACKNOWLEDGE'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' ACKNOWLEDGE SUCCESSFUL'
	ENDIF
.FILL
.tp 30
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.PNT (-71) -- No message in this queue needs to be acknowledged.
.x IE.PNT>Referenced
.le;IE.SNC (-35) -- The wrong message is being acknowledged.
.x IE.SNC>Referenced
.els
.PAGE
.HL 1 ATCHQ.MAC
 
.c ;MODULE
.c ;^&ATCHQ\&
.HL 2ATCHQ               
.nf
.x ATCHQ Subroutine>Defined
Source: ATCHQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
                              TO ZQ0:
    
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR I/O 
                              SYNC
       
   MSGID                      CHARACTER*16  (BYTE(16))
                              MESSAGE ID OF LIST HEAD TO 
                              READ
  
   TEFN                       INTEGER*2
                              EVENT FLAG OF TASK TO BE SET 
                              WHEN A MESSAGE IS IN QUEUE
 
Returns:
 
   ATCHQ                      INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
                              OF THE CONNECT
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows a task to connect to a message id 
queue in the Manufacturing Automation Queue.  The return status is
returned as the value of the function subroutine.  The
calling sequence is:
.sk
.tp 40
.nofill
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	MSGID='DUMMY ID'     ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C CONNECT TO THE QUEUE
C
	STATUS=ATCHQ(LUN,IEFN,MSGID,TEFN)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,
	1	' BAD QUEUE  STATUS ON MESSAGE ID CONNECT'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' CONNECT SUCCESSFUL'
	ENDIF
.FILL
.tp 10
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.URJ (-73) -- Task cannot connect to queue; other task already 
connected.
.x IE.URJ>Referenced
.els
.PAGE
.HL 1 DELQ.MAC
 
.c ;MODULE
.c ;^&DELQ\&
.HL 2DELQ                
.nf
.x DELQ Subroutine>Defined
Source:B4073B"MAQ MAQ"::DELQ.MAC;
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 06-JAN-1987
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
                              TO ZQ0:
    
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR I/O 
                              SYNC
   
   MSGID                      CHARACTER*16  (BYTE(16))
                              MESSAGE ID OF LIST HEAD TO 
                              READ
  
   NBRDEL                     INTEGER*2
                              NUMBER OF MESSAGES TO DELETE 
                              FROM QUEUE
  
Returns:
 
   DELQ                       INTEGER*2 
                              FUNCTION VALUE RETURN STATUS 
                              OF THE CONNECT
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows a task to delete (without acknowledging)
messages from a message id queue in the Manufacturing Automation Queue.
The number of messages to be deleted is specified by the user.
The return status is returned as the value of the function subroutine.  The
calling sequence is:
.sk
.tp 40
.nofill
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 NBRDEL     ! NUMBER OF MESSAGES TO BE 
                             ! DELETED
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	MSGID='DUMMY ID'  ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C ACKNOWLEDGE THE READ
C
	STATUS=DELQ(LUN,IEFN,MSGID,NBRDEL)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE STATUS ON MESSAGE DELETE'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' DELETE SUCCESSFUL'
	ENDIF
.FILL
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (R0 lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.URJ (-73) -- Task cannot connect to queue; other task already 
connected.
.x IE.URJ>Referenced
.els
.PAGE
.HL 1 DISCQ.MAC
 
.c ;MODULE
.c ;^&DISCQ\&
.HL 2DISCQ               
.nf
.x DISCQ Subroutine>Defined
Source: DISCQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :EARL LAKIA
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 15-DEC-86
Revision level     :1.0
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
			      TO ZQ0:
    
 
Returns:
 
   DISCQ                      INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
			      OF THE CONNECT
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine cancels the outstanding I/O normally
set up by the INITQ subroutine.   This subroutine
need not be called if the user doesn't mind the message:
"Task exit with outstanding I/O".  However, good coding
standards should dictate that the caller use this subroutine.
.sk
.tp 40
.nofill
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
        INTEGER*2 QUESUC     ! SUCESSFUL QUEUE STATUS
C
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
        DATA QUESUC/1/
C
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
	STATUS=INITQ(LUN)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE  STATUS ON INIT'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		CALL EXIT
	ELSE
		TYPE *,' INIT SUCCESSFUL'
	ENDIF

   **** ACCESS THE QUEUE *******

	STATUS=DISCQ(LUN)  ! NO NEED TO TEST STATUS, IF IT
		! FAILS, THEN NOTHING ELSE TO DO ANYWAY
.FILL
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.els
.PAGE
.HL 1 INITQ.MAC
 
.c ;MODULE
.c ;^&INITQ\&
.HL 2INITQ               
.nf
.x INITQ Subroutine>Defined
Source: INITQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :EARL LAKIA
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED
			      TO ZQ0:
    
 
Returns:
 
   INITQ                      INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
			      OF THE INIT
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine queues an I/O to ZQ0:.  The returned status
is the directive status as the QIO that is queued never completes
until this task exits and I/O rundown is performed.  Since the
function code that is used is a control function, this should
allow the task to be shuffled, etc.
.sk
.tp 40
.nofill
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
        INTEGER*2 QUESUC     ! SUCCESSFUL QUEUE STATUS
C
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
        DATA QUESUC/1/
C
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
	STATUS=INITQ(LUN)
c
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE  STATUS ON INIT'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		CALL EXIT
	ELSE
		TYPE *,' INIT SUCCESSFUL'
	ENDIF
.FILL
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.els
.PAGE
.HL 1 READHD.MAC
 
.c ;MODULE
.c ;^&READHD\&
.HL 2READHD              
.nf
.x READHD Subroutine>Defined
Source: READHD.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
			      TO ZQ0:
  
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR 
			      I/O SYNC
  
   MSGREC                     BYTE(ISIZE)                          
                              BUFFER TO BE RECEIVE QUEUE 
			      HEADER
                              NOTE: DIMENSIONED TO SIZE 
			      "ISIZE"
   
   ISIZE                      INTEGER*2 
                              SIZE OF BUFFER TO RECEIVE 
			      HEADER
  
  
Returns:
 
   RECSIZ                     INTEGER*2
                              NUMBER OF BYTES READ 
   
   READHD                     INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS OF THE READ
   
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows the caller to read the header of the
Manufacturing Automation Queue.  The return status is
returned as the value of the function subroutine.  The
calling sequence is:
.sk
.tp 40
.nofill
	INCLUDE 'QHDDEF.TXT'
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 RECSIZ     ! RETURNED ACTUAL RECORD SIZE
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C READ THE QUEUE HEADER
C
	STATUS=READHD(LUN,IEFN,QHDDEF,QXKSIZ,RECSIZ)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE STATUS ON HEADER READ'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' SIZE OF QUEUE HEADER: ',RECSIZ
	ENDIF
.FILL
.tp 10
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.le;IE.DAO (-13) -- User buffer to small to contain the queue header.
.x IE.DAO>Referenced
.els
.PAGE
.HL 1 READID.MAC
 
.c ;MODULE
.c ;^&READID\&
.HL 2READID              
.nf
.x READID Subroutine>Defined
Source: READID.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
			      TO ZQ0:
   
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR 
			      I/O SYNC
   
   MSGID                      CHARACTER*16  (BYTE(16))
                              MESSAGE ID OF LIST HEAD 
			      TO READ
  
   MSGREC                     BYTE(ISIZE)                          
                              BUFFER TO BE RECEIVE ID 
			      LIST HEAD 
                              NOTE: DIMENSIONED TO 
			      SIZE "ISIZE"
   
   ISIZE                      INTEGER*2 
                              SIZE OF BUFFER TO RECEIVE 
			      LIST HEAD
 
 
Returns:
 
   RECSIZ                     INTEGER*2
                              NUMBER OF BYTES READ 
     
   READID                     INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
			      OF THE READ
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows the caller to read the list head of a
message id in the Manufacturing Automation Queue.  The return status is
returned as the value of the function subroutine.  The
calling sequence is:
.sk
.tp 40
.nofill
	INCLUDE 'MIDDEF.TXT'
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 RECSIZ     ! RETURNED ACTUAL RECORD SIZE
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	MSGID='DUMMY ID'  ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C  READ THE MESSAGE ID LIST HEAD
C
	STATUS=READID(LUN,IEFN,MSGID,MIDDEF,MXLEN,RECSIZ)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,
	1	' BAD QUEUE STATUS ON ', 
	1	'MESSAGE ID HEADER READ'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' SIZE OF LIST HEAD: ',RECSIZ
	ENDIF
.FILL
.tp10
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.DAO (-13) -- User buffer to small to contain message id header.
.x IE.DAO>Referenced
.els
.PAGE
.HL 1 READQ.MAC
 
.c ;MODULE
.c ;^&READQ\&
.HL 2READQ               
.nf
.x READQ Subroutine>Defined
Source: READQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :EARL LAKIA
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
			      TO ZQ0:
  
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR 
			      I/O SYNC
  
   MSGID                      CHARACTER*16  (BYTE(16))
                              MESSAGE ID OF MESSAGE 
			      TO READ
  
   MSGREC                     BYTE(ISIZE)                          
                              BUFFER TO BE RECEIVE MESSAGE 
			      FROM QUEUE 
                              NOTE: DIMENSIONED TO SIZE 
			      "ISIZE".
  
   ISIZE                      INTEGER*2 
                              SIZE OF BUFFER TO RECEIVE 
			      MESSAGE
 
 
Returns:
 
   RECSIZ                     INTEGER*2
                              ACTUAL RECORD SIZE READ
                              (TOTAL SIZE INCLUDING THE 
			      HEADER SIZE)
  
   RNA                        INTEGER*2  
                              WORD TO RECEIVE READ NOT 
			      ACKNOWLEDGED POINTER
                              (RETURNED FROM ACP/DRIVER 
			      IN I/O STATUS BLOCK)
  
   READQ                      INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
			      OF THE READ
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows the caller to read a message from
the Manufacturing Automation Queue.  The return status is
returned as the value of the function subroutine.  The
RNA pointer must be used to acknowledge the read from the queue
and actually remove it from the queue. The
calling sequence is:
.sk
.tp 40
.nofill
	INCLUDE 'HDRDEF.TXT'
	PARAMETER (BUFSIZ=512)
	BYTE BUFFER(BUFSIZ)  ! INPUT BUFFER
	EQUIVALENCE (BUFFER,HDRDEF)  ! EQUIVALENCE FOR SYMBOLIC 
	                             !  OFFSETS
	INTEGER*2 STATUS      ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 RNA	     ! READ BUT NOT ACKNOWLEDGED POINTER
	INTEGER*2 RECSIZ     ! RETURNED ACTUAL RECORD SIZE
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	MSGID='DUMMY ID'     ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C READ THE MESSAGE FROM QUEUE
C
	STATUS=READQ(LUN,IEFN,MSGID,
	1	BUFFER,BUFSIZ,RECSIZ,RNA)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE STATUS ON READ"
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' RNA POINTER: ',RNA
		TYPE *,' SIZE OF DATA PORTION: ',HxLEN
		WRITE(*,100)(BUFFER(I),I=1,RECSIZ)
 100		FORMAT(' BUFFER: ',20(/,1X,40(Z2.2)))
	ENDIF
.FILL
.tp 15
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.DAO (-13) -- User buffer to small to contain message read.
.x IE.DAO>Referenced
.le;IE.FOP (-53) -- A message exists in the queue that has been read
but not acknowledged.
.x IE.FOP>Referenced
.le;IE.NLK (-79) -- Task is not connected to queue; cannot read any
messages until connected.
.x IE.NLK>Referenced
.le;IE.NST (-80) -- Another task is connected to queue; cannot read
any messages while other task connected.
.x IE.NST>Referenced
.le;IE.EOF (-10) -- No messages in queue.
.x IE.EOF>Referenced
.els
.PAGE
.HL 1 RNAQ.MAC
 
.c ;MODULE
.c ;^&RNAQ\&
.HL 2RNAQ                
.nf
.x RNAQ Subroutine>Defined
Source: RNAQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update: 12-NOV-1986
Revision level     :1.2
 
.C ;Formal Parameter List
Receives:
 
   
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
			      TO ZQ0:
   
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR 
			      I/O SYNC
  
   MSGID                      CHARACTER*16  (BYTE(16))
                              MESSAGE ID OF LIST HEAD 
			      TO READ
 
  
Returns:
 
   RNAQ                       INTEGER*2                               
                              FUNCTION VALUE RETURN STATUS 
			      OF THE CONNECT
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows a read but not acknowledged message to be
placed back at the beginning of a message id queue in the Manufacturing 
Automation Queue.  The return status is returned as the value of the 
function subroutine.  The calling sequence is:
.sk
.tp 40
.nofill
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	CHARACTER*16 MSGID   ! MESSAGE ID
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	MSGID='DUMMY ID'     ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C PUT RNA MESSAGE BACK AT START OF QUEUE
C
	STATUS=RNAQ(LUN,IEFN,MSGID)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE STATUS ON MESSAGE RNA'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' RNA SUCCESSFUL'
	ENDIF
.FILL
.tp 10
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.els
.PAGE
.HL 1 WRITEQ.MAC
 
.c ;MODULE
.c ;^&WRITEQ\&
.HL 2WRITEQ              
.nf
.x WRITEQ Subroutine>Defined
Source: WRITEQ.MAC
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :EARL LAKIA
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update:12-NOV-1986 
Revision level     :1.2
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
			      TO ZQ0:
  
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR 
   			      I/O SYNC
  
   MSGID                      CHARACTER*16	(BYTE(16))
                              MESSAGE ID OF MESSAGE TO 
			      BE WRITTEN
  
   MSGREC                     BYTE(ISIZE)
                              MESSAGE BUFFER TO BE WRITTEN 
			      TO QUEUE           
                              NOTE: DIMENSIONED TO "ISIZE"
  
   ISIZE                      INTEGER*2
                              SIZE OF MESSAGE BUFFER
  
   TYPE                       INTEGER*2
                              RECOVERY IF QUEUE IS FULL, 
			      (0= DELETE OLDEST, 
			       1= RETURN STATUS)
 
Returns:
 
   WRITEQ                     INTEGER*2 
                              FUNCTION VALUE RETURN STATUS 
			      OF THE WRITE.
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows the caller to place a message into
the Manufacturing Automation Queue.  The return status is
returned as the value of the function subroutine.  The
calling sequence is:
.sk
.tp 40
.nofill
	PARAMETER (BUFSIZ=512)
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	CHARACTER*16 MSGID   ! MESSAGE ID
	BYTE BUFFER(BUFSIZ)  ! OUTPUT BUFFER
	INTEGER*2 ITYPE      ! TYPE OF MESSAGE
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/    
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	ITYPE=0		  ! DELETE OLDEST IF FULL
	MSGID='DUMMY ID'  ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C WRITE TO THE MESSAGE ID QUEUE
C
	STATUS=WRITEQ(LUN,IEFN,MSGID,BUFFER,BUFSIZ,ITYPE)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE STATUS ON WRITE'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' SUCCESSFUL WRITE'
	ENDIF
.FILL
.tp 20
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.NDR (-72) -- No room left in queue.
.x IE.NDR>Referenced
.le;IE.NBK (-41) -- Message to be written to queue exceeds 4014 bytes.
.x IE.NBK>Referenced
.els
.PAGE
.HL 1 WRTRTR.MAC
 
.c ;MODULE
.c ;^&WRTRTR\&
.HL 2WRTRTR              
.nf
.x WRTRTR Subroutine>Defined
Source:B4073A"MAQ MAQ"::WRTRTR.MAC;
TO BECOME PART OF LIBRARY:QUEUE.OLB
Designer           :EARL LAKIA
Author             :DAVE LUECK
Copy Right: Inland Steel
            Process Automation Department
            3210 Watling St.  MS 2-465
            East Chicago, IN  46312
 
Date of last update:08-DEC-1986 
Revision level     :1.1
 
.C ;Formal Parameter List
Receives:
 
   LUN                        INTEGER*2
                              LOGICAL UNIT NUMBER ASSIGNED 
                              TO ZQ0:
  
   EFN                        INTEGER*2
                              EVENT FLAG TO BE USED FOR I/O 
                              SYNC
  
   MSGID                      CHARACTER*16	(BYTE(16))
                              MESSAGE ID OF MESSAGE TO BE 
                              WRITTEN
  
   MSGREC                     BYTE(ISIZE)
                              MESSAGE BUFFER TO BE WRITTEN 
                              TO QUEUE
                              NOTE: DIMENSIONED TO SIZE 
                              ISIZE
  
   ISIZE                      INTEGER*2
                              SIZE OF MESSAGE BUFFER
  
   TYPE                       INTEGER*2
                              RECOVERY IF QUEUE IS FULL, 
                              (0= DELETE OLDEST,
                               1= RETURN STATUS)
 
Returns:
 
   WRTRTR                     INTEGER*2 
                              FUNCTION VALUE RETURN STATUS 
                              OF THE WRITE
 
Accesses common(s):
 
Accesses file(s):
 
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine allows the caller to place a message into
the Manufacturing Automation Queue.  The only difference between this
routine and the WRITEQ routine is that the header does not get added
to the front of the text when this routine is called.  The MAQ router
uses this routine to bypass adding the header since it already precedes
the data.
.x WRITEQ Subroutine>Referenced
The return status is returned as the value of the function subroutine.  
The calling sequence is:
.sk
.tp 40
.nofill
	PARAMETER (BUFSIZ=512)
	INTEGER*2 LUN	     ! LUN ASSIGNED TO ZQ0:
	INTEGER*2 IEFN	     ! EVENT FLAG
	CHARACTER*16 MSGID   ! MESSAGE ID
	BYTE BUFFER(BUFSIZ)  ! OUTPUT BUFFER
	INTEGER*2 ITYPE      ! TYPE OF MESSAGE
	INTEGER*2 STATUS     ! RETURN STATUS
	BYTE STATB(2)
	EQUIVALENCE(STATUS,STATB) ! BYTE ADDRESSABLE STATUS
	INTEGER*2 QUESUC     ! SUCCESSFUL QUE STATUS
C
	DATA QUESUC/"401/    
	DATA LUN/1/	     ! LOGICAL UNIT NUMBER
	DATA IEFN/1/	     ! EVENT FLAG FOR I/O SYNC
C
	ITYPE=0		  ! DELETE OLDEST IF FULL
	MSGID='DUMMY ID'  ! OUR MESSAGE ID
C
C ASSIGN A LUN TO THE PSEUDO DEVICE FOR THE QUEUE
C
	CALL ASSIGN(LUN,'ZQ0:')
C
C WRITE TO THE MESSAGE ID QUEUE
C
	STATUS=WRTRTR(LUN,IEFN,MSGID,BUFFER,BUFSIZ,ITYPE)
C
	IF(STATUS .NE. QUESUC)THEN
		TYPE *,' BAD QUEUE STATUS ON RTR WRITE'
		TYPE *,' DIRECTIVE STATUS: ',STATB(1)
		TYPE *,' I/O STATUS: ',STATB(2)
		CALL EXIT
	ELSE
		TYPE *,' SUCCESSFUL RTR WRITE'
	ENDIF
.FILL
.SK
	Possible error codes:
.LIST 1,' '
.le;Bad directive status (possibly device not mounted, etc.)
(upper byte will be zero)
.le;Bad I/O status (R0 lower byte= 1,  upper byte= I/O status)
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Referenced
.le;IE.NDR (-72) -- No room left in queue.
.x IE.NDR>Referenced
.le;IE.NBK (-41) -- Message to be written to queue exceeds 4014 bytes.
.x IE.NBK>Referenced
.els
.PAGE
.HL 1 VAXQAD.MAC

.c ;MODULE
.c ;^&VAXQAD\&
.HL 2VAXQAD
.nf
.x VAXQAD Subroutine>Define
Source: VAXQAD.MAC
To become part of library:QUEUE
Designer           :EARL LAKIA
Author             :EARL LAKIA (DEFAULT DESIGNER)
Date of last update:30-SEP-86
Revision level     :1.0
	
.C ;Formal Parameter List
Receives:
    
Returns:
  
  VAXTIME          INTEGER*2  Dimension (4)
		   ARRAY TO RECEIVE THE VAX QUAD 
		   TIME WORD (64 BIT TIME VALUE)
	
Accesses common(s):
	
Accesses file(s):
	
Other modules referenced:
.SK
.fill
.SK
Description:
.sk    
	This subroutine is called to get the current time and convert 
the time to the vax equivalent time stamp.  The caller must pass the
4 word array by address.  The calling sequence is:
.NOFILL
 
	INTEGER*2 VAXTIME(4)
	CALL VAXQAD(VAXTIME)
.FILL
.PAGE
 
.c ;MODULE
.c ;^&VAXQDD\&
.HL 2VAXQDD              
.nf
.x VAXQDD Subroutine>Defined
Source: VAXQAD.MAC
To become part of library:QUEUE
Designer           :EARL LAKIA
Author             :EARL LAKIA (DEFAULT DESIGNER)
Date of last update:03-OCT-86
Revision level     :1.0
	
.C ;Formal Parameter List
Receives:

  HOUR             INTEGER*2  CURRENT HOUR OF THE 
		   DAY (0 TO 23)
  
  MIN              INTEGER*2  CURRENT MINUTE OF 
		   HOUR (0-59)
  
  SEC              INTEGER*2  CURRENT SECOND OF 
		   THE MINUTE (0-59)
  
  MONTH            INTEGER*2  MONTH OF YEAR 
		   (1 TO 12)
  
  DAY              INTEGER*2  CURRENT DAY OF 
		   THE MONTH (1 TO 31 DEPENDING 
                   ON MONTH)
 
  YEAR             INTEGER*2  YEAR SINCE 1900, 
		   (0 TO 99)
    
Returns:
  
  QUAD             INT*2(4)   
		   FOUR WORD INTEGER*2 ARRAY 
		   TO RECEIVE THE VAX EQUIVALENT 
		   QUAD WORD TIME.
	
Accesses common(s):
	
Accesses file(s):
	
Other modules referenced:
.SK
.fill
.SK
.TP 20
Description:
.sk    
	This subroutine is called to return the VAX standard
QUAD time format into the associated element 
of the 	QUAD array.  The Vax standard time  is shown below
along with element number of the QUAD array.
.SK
.nofill
3322 2222 2222 1111 1111 1100 0000 0000
1098 7654 3210 9876 5432 1098 7654 3210

    QUAD   2       !      QUAD  1

6666 5555 5555 5544 4444 4444 3333 3333
3210 9876 5432 1098 7654 3210 9876 5432

   QUAD   4        !      QUAD  3

.SK
.fill
	Note the bit order of the VAX time format which
has low precision bits first in the two long words.
The value of OCT 3, 1986 at 11:00#AM is:  4507F800 008F5E18.
	This subroutine is accurate to plus or minus
512 milliseconds due to the accuracy of the double
precision floating point arithmetic.
	The calling sequence is:
.SK 2
.NOFILL
         INTEGER*2 MONTH,YEAR,DAY,HOUR,MINUTE,SECOND
         INTEGER*2 QUAD(4)
         DATA MONTH/10/,DAY/3/,HOUR/0/,MINUTE/0/,SECOND/0/
         DATA YEAR/86/
C
         CALL VAXQDD(HOUR,MINUTE,SECOND,MONTH,DAY,YEAR,QUAD)
.FILL
.CH APPLICATION GUIDE
	The steps that must be followed to read from or write to the queue
are detailed in the QUEUE PHYSICAL FLOW section of the QUEUE FUNCTIONS 
chapter.  If you want the Router to write node connect/disconnect messages
to the queue, review the ROUTING SPECIFICS section of the ROUTING TASK chapter
for details.
.hl APPLICATION PROGRAMMING NOTES
	Any program that connects to the Queue must have
called the INITQ subroutine.  This subroutine posts an
I/O request that is never satisfied.  The purpose of
this unsatisfied I/O is to allow the ACP to handle I/O rundown and
exit handling.  Therefore, any
task that has called this routine will have an I/O count
of at least one.  The subroutine DISCQ can be called
to gracefully satisfy this last I/O before exit. If this
subroutine is not called, the Task Termination message of
"TASK EXIT WITH OUTSTANDING I/O" will be displayed.
.x DISCQ Subroutine>Referenced
.x INITQ Subroutine>Referenced
	Any task that reads messages from the Queue must be connected
to the message id subqueue it will read messages from.  If the task 
must receive messages as soon as they are queued by the ACP, it should be
waiting on the local event flag that is set by the ACP when the ACP
writes a message to that subqueue.  When the local event flag is set, the
task should clear the event flag before it reads the message,
continue to read, process, and acknowledge messages until an IE.EOF
error (no messages in subqueue) is returned, and again
wait for the event flag once all messages in the subqueue have been
read.  If the task
exits, it will disconnect from the message id and will not be able
to read other messages written to the subqueue by the ACP unless the task
is activated by another task in the system.  The ACP will not set the local
event flag of a task and run the task unless it is connected to
the message id subqueue it will read.  
.x WTQUE Task>Defined
.x RDQUE Task>Defined
	Two sample programs are included in the distribution.  One
program, WTQUE, shows how easy it is to write to the Queue.  
Writing a message of Type 0 means that the message can be deleted
when the Queue becomes full.  A message of Type 1 cannot be deleted
when the Queue becomes full.  The other
program, RDQUE, is an example of how to implement the message reading
strategy described in the previous paragraph.  All programs that
read messages from the Queue should use Program RDQUE as a template.
These two programs can be built with the command files WTQUE.CMD and
RDQUE.CMD.  The two programs reference the message id SAMPLE_QUEUE.
This message id is already in the message id
.x QUEUEIDS.DAT File>Referenced
file QUEUEIDS.DAT on the distribution tape.
.HL COMPILING, ASSEMBLING, AND TASK BUILDING
.X HDRDEF.TXT File>Referenced
.X MIDDEF.TXT File>Referenced
.X QHDDEF.TXT File>Referenced
.X QUEUE.MLB Library>Referenced
.X QUEUE.OLB Library>Referenced
	To define Queue structures in a Fortran program, include
the files HDRDEF.TXT, MIDDEF.TXT, and QHDDEF.TXT in the Fortran
source code file.  To access the queueing routines from a Fortran
program, include the object library QUEUE.OLB in the task build command
line.  To include Queue or Routing structure offsets in an assembly language
program, include the desired offsets in the macro source code
file using the .MCALL directive and reference the QUEUE.MLB
macro library in the assembly command line.  All Queue and Routing
structure offsets are contained in the QUEUE.MLB macro library.
.hl TEST PROGRAMS
	To verify the functioning of the ACP and to test the queue
during program debug, use Program TSTACP.  This program tests all
of the functions of the Queue ACP and the ZQ device driver.
The source code for this program is available and may be used as
a sample program example.
.x TSTACP Task>Defined
	If the ACP needs extensive testing to find a bug,
the test programs WRTQ and REDQ can be used.  Program WRTQ will issue
a number of write requests to the ACP.  The size of the message written
and the type of the message (0 or 1) is determined by the FORTRAN random
number function RAN.  WRTQ will ask the user to enter both the 'message
size' and 'message type' seeds.  As long as the same seeds are used every
time, the sequence of writes will be the same.  To check the sequence of
writes after the test, run Program RAND and enter the same seeds.  Program
REDQ will read all messages written to the queue and acknowledge, or
occasionally requeue, the message read.  When testing with these two
tasks, all debug messages will be written to the file QUEACPMSG.DAT by Program
QUELOG.  Program CLSMSG will close the file to allow access by PIP or EDT.
QUEACP must be built with the 'debug message' and 'log program' options
before it will send debug messages to Program QUELOG.  The testing can
be started by invoking QUETST.CMD and stopped by invoking QUESTP.CMD.
NOTE: To build all of these test tasks, invoke the command files WRTQ.CMD,
REDQ.CMD, RAND.CMD, QUELOG.CMD, and CLSMSG.CMD.
.X QUEACP Task>Referenced
.x WRTQ Task>Defined
.x REDQ Task>Defined
.x QUELOG Task>Defined
.x CLSMSG Task>Defined
.x RAND Task>Defined
	Program TRACEQ will trace through an entire message id subqueue and 
display the block numbers of all message blocks used and the links.  When 
finished, the program will display the total block count and total message 
count.  The user is asked to enter the starting block number (obtained
from the QMT/DID/ID:message_id switch) and the total number
of blocks used by the Queue header.  This program should only be run
when queueing functions are disabled (i.e. the ZQ driver is dismounted
from the ACP).
This program is built by the command file TRACEQ.CMD.
.x TRACEQ Task>Defined
	Another program is available to display the Routing Database.
This task is NRBDMP.  It will display the contents of the database header 
and the contents of each NRB (node routing block) in the database.  The
program can be used to check the availability of remote nodes and for
troubleshooting routing problems.
.x NRBDMP Task>Referenced
.CH INSTALLATION GUIDE
	The RSX Queueing and Routing software is available on a
single magtape (TK50 or 9 channel).  The ZQ driver is normally
supplied when the target computer is sysgenned with
the INLANDPLS.SGN command file.  If the driver was not supplied when the
system was sysgenned, the driver can still be built from the distribution
magtape.  The software on the magtape
distribution is in UIC [7,5] in BRU format (1600 BPI).
UIC [7,5] should be created on the target system disk 
and used for the Queueing and Routing software. 
If UIC [7,5] is already being used, 
select and create another priviledged UIC.  
	The following libraries are needed for assembling and task
building.  The necessary object libraries are:
.list 1,'o'
.le;LB:[1,1]F4POTSFCS.OLB
.LE;LB:[1,1]RMSLIB.OLB (only needed for Task QMT)
.le;LB:[1,1]F4POTSRMS.OLB (only needed for Task QMT)
.LE;LB:[1,1]EXELIB.OLB
.LE;LB:[1,1]SYSLIB.OLB
.LE;LB:[*,*]QUEUE.OLB (This library can be created as described below; 
the UIC [*,*] refers to the UIC selected for the Queueing and Routing
software.)
.ELS
	The necessary macro libraries are:
.list 1,'o'
.le;LB:[1,1]NETLIB.MLB
.LE;LB:[1,1]EXEMC.MLB
.LE;LB:[*,*]QUEUE.MLB (This library can be created as described below; 
the UIC [*,*] refers to the UIC selected for the Queueing and Routing
software.)
.ELS
	The necessary supervisor-mode libraries are:
.list 1,'o'
.le;LB:[3,54]RMSRES.TSK (only needed for Task QMT)
.LE;LB:[1,1]FCSFSL.TSK (only needed for the ACP, QUEACP)
.ELS
	The following command files are available for your
use and are listed in the order they should be invoked.
All of the command files will allow for selective assemble/compile,
task build, and installation.  The command files expect the Fortran 
compiler to be installed as Task ...FTN. 
Before building the Routing Database with
command file RTRRSX.CMD, the database macro source file RTRDBS.MAC
must be created.  Review the ROUTING DATABASE section of the ROUTING TASK
chapter for details. A sample RTRDBS.MAC file is on the distribution tape.
.x RTRDBS Routing Database>Referenced
.list
.le;ZQBLD.CMD- This command file will build the ZQ driver if the driver
was not built during the sysgen phase.
.le;QUEDEF.CMD- This command file will build the macro
library QUEUE.MLB.
.le;QUESUB.CMD- This command file will assemble and place all
of the queue service subroutines into the QUEUE.OLB object
library.
.le;QUEACP.CMD- This command file will assemble and build the ACP.
If the queueing software is not located in UIC [7,5], be sure
to enter the UIC for file MAQUEUE.DAT when asked.
.x MAQUEUE.DAT File>Referenced
.x QUEUEIDS.DAT File>Referenced
.x QUEACP Task>Referenced
.le;QMT.CMD- This command file will build the queue maintenance
task QMT.  If the queueing software is not located in UIC [7,5], be sure
to enter the UIC for files MAQUEUE.DAT and QUEUEIDS.DAT when asked.
.x QMT Task>Referenced
.le;TSTACP.CMD- This command file will build the ACP test task TSTACP.
.x TSTACP Task>Referenced
.LE;RTRRSX.CMD- This command file will assemble and build the 
Router and the Routing Database.
.x RTRRSX Task>Referenced
.le;FNDSRV.CMD- This command file will build the find service task
FNDSRV.  
.x FNDSRV Task>Referenced
.LE;NRBDMP.CMD- This command file will build the task that displays 
the Routing Database.
.x NRBDMP Task>Referenced
.els
.hl 1 QUEUEING and ROUTING STARTUP
	The command files STARTQ.CMD and STARTR.CMD may be
used to bring up the queueing software and the routing software
respectively.  These command files can be invoked from STARTUP.CMD
after the DECnet network has been installed.
Obviously, prior to either of these being
run, the QMT task must have created a Queue and the Routing
.x QMT Task>Referenced
Database must have been created.
Command file STOPR.CMD will stop and remove the routing software,
and command file STOPQ.CMD will stop and remove the queueing software.
.AX MESSAGE STRUCTURES
	The following macros are available as either include
files or from the macro library.  Since Fortran#77 does not support
the period symbol as part of a variable name and structures are
not defined, the period in the offsets has been replaced by
the lower case "x".
.page
.nofill
.center;HDRDEF.TXT
!
! DEFINE THE STRUCTURE OF THE MESSAGE HEADER. 
!
! THIS IS STRUCTURE CAN BE USED TO FORM A RECORD THAT 
! CAN BE READ  FROM THE QUEUE.  IE: CONCATENATE THIS 
! STRUCTURE TO PROCEED  THE ACTUAL DATA TO BE RETURNED 
! ON A READ_Q.
! 
!
! DATE OF LAST UPDATE:  8/11/86
!
! COPY RIGHT: 
!		INLAND STEEL
!		PROCESS AUTOMATION DEPT.
!		3210 WATLING ST. MS 2-465
!		EAST CHICAGO, IN   46312
!		
	PARAMETER (HxSIZ=34)
C
	BYTE HDRDEF(HxSIZ)
	BYTE HxSNM(6)		! ASCII DECNET SOURCE NODE 
				! NAME (FOR MESSAGES QUEUED 
				! WITHIN A NODE,
				! THIS WILL BE BLANK)
	BYTE HxDNM(6)		! DESTINATION DECNET NODE 
				! NAME FOR MESSAGES QUEUED 
				! WITHIN A NODE,
				! THIS WILL BE BLANK).
	INTEGER*2 HxOFQT(4)	! OFF QUEUE TIME (FILLED 
				! IN DURING READ)
	INTEGER*2 HxTYPE	! TYPE OF MESSAGE 

	! 0= MESSAGE CAN BE DELETED WHEN QUEUE IS FULL 
	!    AND THIS IS OLDEST
	! 1= MESSAGE IS NOT TO BE DELETED  
	!    EVEN IF QUEUE IS FULL
	! 2= IF REMOTE NODE QUEUE IS FULL, THEN 
	!    DO NOT QUEUE ON REMOTE NODE

	INTEGER*2 HxONQT(4)	! ON QUEUE TIME (FILLED IN 
				! WHEN MESSAGE WAS FIRST 
				! WRITTEN TO A QUEUE EITHER 
				! LOCALLY OR ON THE REMOTE 
				! QUEUE (IT IS PRESERVED
				! WHEN REQUEUED ON TARGET 
				! NODE)
	INTEGER*2 HxLEN		! BYTE COUNT OF MESSAGE 
				!  (DOES NOT INCLUDE HEADER)
	INTEGER*2 HxQSEQ	! ON QUEUE SEQUENCE NUMBER 
C
	PARAMETER (HxMXSQ=9999)
C
	EQUIVALENCE (HDRDEF(1),HxSNM)
	EQUIVALENCE (HDRDEF(7),HxDNM)
	EQUIVALENCE (HDRDEF(13),HxOFQT)
	EQUIVALENCE (HDRDEF(21),HxTYPE)
	EQUIVALENCE (HDRDEF(23),HxONQT)
	EQUIVALENCE (HDRDEF(31),HxLEN)
	EQUIVALENCE (HDRDEF(33),HxQSEQ)
.PAGE
.CENTER;MIDDEF.TXT
!
! SINGLE MESSAGE ID LIST HEAD STRUCTURE
!
! COPY RIGHT: 
!		INLAND STEEL
!		PROCESS AUTOMATION DEPT.
!		3210 WATLING ST. MS 2-465
!		EAST CHICAGO, IN   46312
!		
! DATE OF LAST UPDATE:  13-OCT-86
!
	INTEGER MxLEN
	PARAMETER(MxLEN=44)	! SIZE OF MESSAGE ID LIST 
				! HEAD
	INTEGER MxIDSZ
	PARAMETER(MxIDSZ= 16)	! SIZE OF A SINGLE MESSAGE 
				! ID
	BYTE MIDDEF(MxLEN)
!
	BYTE MxMID(MxIDSZ)	! ASCII MESSAGE ID
	INTEGER*2 MxFLK		! FORWARD LINK TO FIRST 
				! MESSAGE IN QUEUE THIS ID
	INTEGER*2 MxBLK		! BACKWARD LINK TO LAST 
				! MESSAGE IN QUEUE THIS ID
	INTEGER*2 MxRNA		! READ BUT NOT ACK. MESG. 
				! FIRST BLOCK LINK
	INTEGER*2 MxBNA		! READ BUT NOT ACK. MESG. 
				! LAST BLOCK LINK
	INTEGER*2 MxMAX		! MAXIMUM NUMBER OF 
				! MESSAGES ALLOWED THIS ID
	INTEGER*2 MxCNT		! CURRENT NUMBER IN QUEUE 
				! THIS MESSAGE ID
	INTEGER*2 MxQSEQ	! CURRENT ON QUEUE SEQUENCE 
				! NUMBER
	INTEGER*2 MxR50(2)	! RAD 50 CONNECTED TASK NAME
	INTEGER*2 MxTCB		! TCB ADDRESS OF CONNECTED 
				! TASK NAME
	INTEGER*2 MxEFN		! READER'S EFN TO SET IF 
				! MxCNT GOES NON-ZERO
	INTEGER*2 MxNVC		! NUMBER VOLATILE MESSAGES
	INTEGER*2 MxNVL		! LINK TO NEXT SCANNABLE 
				! VOLATILE MESSAGE
	INTEGER*2 MxLST		! LAST BLOCK NBR OF MESSAGE 
				! LINKED TO LAST SCANNED
C
	EQUIVALENCE(MIDDEF(1),MxMID)
	EQUIVALENCE(MIDDEF(17),MxFLK)
	EQUIVALENCE(MIDDEF(19),MxBLK)
	EQUIVALENCE(MIDDEF(21),MxRNA)
	EQUIVALENCE(MIDDEF(23),MxBNA)
	EQUIVALENCE(MIDDEF(25),MxMAX)
	EQUIVALENCE(MIDDEF(27),MxCNT)
	EQUIVALENCE(MIDDEF(29),MxQSEQ)
	EQUIVALENCE(MIDDEF(31),MxR50)
	EQUIVALENCE(MIDDEF(35),MxTCB)
	EQUIVALENCE(MIDDEF(37),MxEFN)
	EQUIVALENCE(MIDDEF(39),MxNVC)
	EQUIVALENCE(MIDDEF(41),MxNVL)
	EQUIVALENCE(MIDDEF(43),MxLST)
.PAGE
.CENTER;QHDDEF.TXT
!
! QUEUE SECTION FILE HEADER STRUCTURE
!
!
! COPY RIGHT: 
!		INLAND STEEL
!		PROCESS AUTOMATION DEPT.
!		3210 WATLING ST. MS 2-465
!		EAST CHICAGO, IN   46312
!		
! DATE OF LAST UPDATE:  9/16/86
!
	INTEGER QxKSIZ
	PARAMETER (QxKSIZ=20)	! SIZE OF QUEUE HEADER
	BYTE QHDDEF(QxKSIZ)
	INTEGER*2 QxSIZ		! SIZE OF QUEUE IN 512 
				! BYTE BLOCKS
	INTEGER*2 QxUPD(4) 	! QUAD WORD FOR LAST 
				! UPDATED TIME STAMP
	INTEGER*2 QxIDC 	! ACTUAL NUMBER OF ID'S IN 
				! USE OR DEFINED
	INTEGER*2 QxFREE 	! NUMBER OF FREE BLOCKS 
	BYTE QxNODE(6)		! LOCAL NODE NAME
C
	EQUIVALENCE(QHDDEF(1),QxSIZ)
	EQUIVALENCE(QHDDEF(3),QxUPD)
	EQUIVALENCE(QHDDEF(11),QxIDC)
	EQUIVALENCE(QHDDEF(13),QxFREE)
	EQUIVALENCE(QHDDEF(15),QxNODE)
.PAGE
.CENTER;HDRDEF.MAC
	.MACRO	HDRDEF,$GBL
;
; DEFINE THE STRUCTURE OF THE MESSAGE HEADER. 
;
; THIS IS STRUCTURE CAN BE USED TO FORM A RECORD THAT CAN 
; BE READ FROM THE QUEUE.  IE: CONCATENATE THIS STRUCTURE 
; TO PROCEED THE ACTUAL DATA TO BE RETURNED ON A READ_Q.
; 
;
; DATE OF LAST UPDATE:  8/11/86
;
; COPY RIGHT: 
;		INLAND STEEL
;		PROCESS AUTOMATION DEPT.
;		3210 WATLING ST. MS 2-465
;		EAST CHICAGO, IN   46312
;		
	.ASECT	
 .=0
H.SNM:	.BLKB	6	; ASCII DECNET SOURCE NODE NAME
			; (FOR MESSAGES QUEUED WITHIN A NODE
			; THIS WILL BE BLANK)
H.DNM:	.BLKB	6	; DESTINATION DECNET NODE NAME
			; FOR MESSAGES QUEUED WITHIN A NODE,
			; THIS WILL BE BLANK).
H.OFQT:	.BLKW	4	; OFF QUEUE TIME (FILLED IN DURING 
			; READ)
H.TYPE:	.BLKW	1	; TYPE OF MESSAGE 
;
	; 0= MESSAGE CAN BE DELETED WHEN QUEUE IS FULL AND 
	;    THIS IS OLDEST
	; 1= MESSAGE IS NOT TO BE DELETED  EVEN IF QUEUE IS
	;    FULL
	; 2= IF REMOTE NODE QUEUE IS FULL, THEN DO NOT 
	;    QUEUE ON REMOTE NODE
;
H.ONQT:	.BLKW	4	; ON QUEUE TIME (FILLED IN WHEN 
			; MESSAGE WAS FIRST WRITTEN TO A 
			; QUEUE EITHER LOCALLY OR ON THE 
			; REMOTE QUEUE. IT IS PRESERVED
			; WHEN REQUEUED ON TARGET NODE)
H.LEN:	.BLKW	1	; BYTE COUNT OF MESSAGE (DOES NOT 
			; INCLUDE HEADER)
H.QSEQ:	.BLKW	1	; ON QUEUE SEQUENCE NUMBER 
H.SIZ=.			; MINIMUM MESSAGE SIZE
H.MXSQ=9999.		; MAXIMUM ON QUEUE SEQUENCE NUMBER
 .=0
	.ENDM
.PAGE
.CENTER;MGHDEF.MAC
	.MACRO	MGHDEF
;
; Revision: 1.1
; Date of last update: 12/10/86
; Author:  Earl Lakia
;
; This macro defines the message that is sent between 
; cooperating MA Routers.  This is basically, the preamble
; to the message as it is received from the queue.  
;
	.ASECT
 .=0
MG.LSQ:	.BLKW	1	; LINK SEQUENCE NUMBER
MG.RNA: .BLKW	1	; RNA
MG.IDX:	.BLKW	1	; INDEX 
MG.MID:	.BLKB	16.	; MESSAGE ID
MG.SIZ=.
 .=0
;
; NORMALLY, THE MESSAGE HEADER, AND MESSAGE FOLLOW HERE
;
; H.SNM:
; H.DNM:
; H.OFQT:
; . . .
; . . .
; . . .
;
	.ENDM
.PAGE
.CENTER;MIDDEF.MAC
;
; SINGLE MESSAGE ID LIST HEAD STRUCTURE
;
; COPY RIGHT: 
;		INLAND STEEL
;		PROCESS AUTOMATION DEPT.
;		3210 WATLING ST. MS 2-465
;		EAST CHICAGO, IN   46312
;		
; DATE OF LAST UPDATE: 13-OCT-86
;
	.MACRO	MIDDEF
	.ASECT
 .=0
M.IDSIZ	= 16.			; SIZE OF A SINGLE MESSAGE 
				; ID
M.MID:	.BLKB	M.IDSIZ		; ASCII MESSAGE ID
M.FLK:	.BLKW	1		; FORWARD LINK TO FIRST 
				; BLOCK OF FIRST MESSAGE 
				; IN QUEUE THIS ID
M.BLK:	.BLKW	1		; BACKWARD LINK TO LAST 
				; BLOCK OF LAST MESSAGE 
				; IN QUEUE THIS ID
M.RNA:	.BLKW	1		; READ BUT NOT ACK. MESG. 
				; FIRST BLOCK LINK
M.BNA:	.BLKW	1		; READ BUT NOT ACK. MESG. 
				; LAST BLOCK LINK
M.MAX:	.BLKW	1		; MAXIMUM NUMBER OF 
				; MESSAGES ALLOWED THIS ID
M.CNT:	.BLKW	1		; CURRENT NUMBER IN QUEUE 
				; THIS MESSAGE ID
M.QSEQ:	.BLKW	1		; CURRENT ON QUEUE SEQUENCE 
				; NUMBER
M.R50:	.BLKW	2		; RAD 50 CONNECTED TASK NAME
M.TCB:	.BLKW	1		; TCB ADDRESS OF CONNECTED 
				; TASK NAME
M.EFN:	.BLKW	1		; READER'S EFN TO SET IF 
				; M.CNT GOES NON-ZERO
M.NVC:	.BLKW	1		; NUMBER VOLATILE MESSAGES
M.NVL:	.BLKW	1		; LINK TO LAST SCANNED 
				; VOLATILE MESSAGE
M.LST:	.BLKW	1		; LAST BLOCK NBR OF MESSAGE
				; LINKED TO LAST SCANNED
M.LEN=.
 .=0
	.ENDM
.PAGE
.CENTER;NRBDEF.MAC
;
; NRBDEF
;	Routing database node routing block (NRB) offset 
;       definition.
;
; Date of last update:  06/08/87
; Author: Earl Lakia
;
	.MACRO	NRBDEF
	.ASECT
 .=0
N.LUN:	 .BLKW	1	; LUN USED TO CONNECT TO NODE
N.STS:	 .BLKW	1	; NODE STATUS SEE BELOW
N.LNK:	 .BLKW	1	; LINK TO NEXT NRB
N.CUR:	 .BLKB	6	; ACTUAL CURRENT NODE NAME
N.PRI:	 .BLKB	6	; PRIMARY NODE NAME
N.SEC:	 .BLKB	6	; SECONDARY NODE NAME
N.ACC:	 .BLKB	60.	; ACCESS CONTROL STRING
N.NCB:	 .BLKB	N.RQL	; NETWORK CONNECT BLOCK
N.IDS:	 .BLKW	1	; TOTAL MSG ID'S THIS NODE
N.ULNK:  .BLKW	1	; LINK TO UNSOLICITED INPUT BUFFER
N.IBSA:	 .BLKW	1	; ADDRESS OF NETWORK RECEIVE I/O 
			; STATUS BLOCK
N.IOSB:  .BLKW	2	; NETWORK RECEIVE I/O STATUS BLOCK
N.ISAC:	 .BLKW	1	; ADDRESS OF CONNECT/DISCONNECT 
			; I/O STATUS BLOCK
N.IOSC:  .BLKW	2	; CONNECT/DISCONNECT I/O STATUS 
			; BLOCK
N.ISAU:	 .BLKW	1	; ADDRESS OF NETWORK DATA I/O 
			; STATUS BLOCK
N.IOSU:  .BLKW	2	; NETWORK I/O STATUS BLOCK
N.SEQ:	 .BLKW	1	; LINK SEQUENCE NUMBER INBOUND
N.OSEQ:	 .BLKW	1	; LINK SEQUENCE NUMBER OUTBOUND
N.OIDS:  .BLKW	1	; ADDRESS OF LAST SCANNED OUTBOUND 
			; NRBID
N.STAM:  .BLKW  1	; CONNECT/DISCONNECT STATUS FOR 
			; WRITE TO QUEUE
N.MBX:   .BLKB  N.CBL+30   ; SAVE BUFFER FOR NETWORK 
                           ;   CONNECT REQUEST MESSAGE
N.IDXL=.		; START OF THE MESSAGE ID'S ROUTED 
			; BY THIS NODE
 .=0
NID.IX:	.BLKW	1	; LINK TO QUEUE MESSAGE ID LIST 
			; HEAD 
NID.RA:	.BLKW	1	; RNA FOR THIS MESSAGE ID
NID.ST:	.BLKW	1	; MSG ID STATUS WORD SEE BELOW
NID.NM:	.BLKB	16.	; ASCII MESSAGE ID BEING ROUTED
NID.LN=.
 .=0
;
; N.STS BIT DEFINITIONS
;
NS.AVL=	1	; NODE IS AVAILABLE
NS.DWN=	2	; NODE IS DOWN
NS.CPN=	4	; LOCAL CONNECT IN PROGRESS
NS.CTM=10	; CONNECT TIMER IS ACTIVE
NS.SEC=20	; SECONDARY NODE IS CONNECTED
NS.PRI=40	; PRIMARY NODE IS CONNECTED
NS.RCN=100	; REMOTE NODE REQUESTED THE CONNECTION
NS.LND=200	; PRIMARY NODE NAME IS A LOGICAL NODE NAME
NS.NOD=400	; ACTUAL NODE NAME OF A LOGICAL NODE 
		; RECEIVED
NS.DPN=1000	; LOCAL DISCONNECT IN PROGRESS
;
; NID.ST BIT DEFINITIONS
;
NIS.RT= 1	; MSG ID NOT ROUTABLE
		; BITS 14 AND 15 (LAST TWO MSB's) ARE USED BY 
		;   ROUTER FOR READ RETRY COUNTER
	.ENDM
.PAGE
.CENTER;OUTDEF.MAC
;
; OUTDEF
;	Routing database output buffer offset definition
;
; Date of last update:  12/04/86
; Author: Earl Lakia
;
	.MACRO	OUTDEF
	.ASECT
 .=0
O.LNK:	.BLKW	1	; LINK TO NEXT BUFFER
O.NRB:	.BLKW	1	; LINK TO NRB USING THIS BUFFER
O.IOSB:	.BLKW	2	; STATUS BLOCK OF NODE USING THIS 
			; BUFFER
O.BUF:	.BLKW	1	; OUTPUT BUFFER
 .=0
	.ENDM
.PAGE
.CENTER;QHDDEF.MAC
;
; QUEUE SECTION FILE HEADER STRUCTURE
;
;
; COPY RIGHT: 
;		INLAND STEEL
;		PROCESS AUTOMATION DEPT.
;		3210 WATLING ST. MS 2-465
;		EAST CHICAGO, IN   46312
;		
; DATE OF LAST UPDATE:  8/27/86
;
	.MACRO	QHDDEF
	.ASECT
 .=0
Q.SIZ:	.BLKW	1	; SIZE OF QUEUE IN 512 BYTE BLOCKS
Q.UPD:	.BLKW	4	; QUAD WORD FOR LAST UPDATED TIME 
			; STAMP
Q.IDC:	.BLKW	1	; ACTUAL NUMBER OF ID'S IN USE OR 
			; DEFINED
Q.FREE:	.BLKW	1	; NUMBER OF FREE BLOCKS 
Q.NODE:	.BLKB	6	; LOCAL NODE NAME
Q.KSIZ=.		; SIZE OF LIST HEAD
 .=0
	.ENDM
.PAGE
.CENTER;RSPDEF.MAC
;
; RSPDEF
;	Routing database response buffer offset definition
;
; Date of last update:  12/04/86
; Author: Earl Lakia
;
	.MACRO	RSPDEF
	.ASECT
 .=0
R.LNK:	.BLKW	1	; LINK TO NEXT BUFFER
R.NRB:	.BLKW	1	; LINK TO NRB USING THIS BUFFER
R.IOSB:	.BLKW	2	; STATUS BLOCK OF NODE USING THIS 
			; BUFFER
R.BUF:	.BLKW	1	; RESPONSE BUFFER
R.SIZ=.
 .=0
	.ENDM
.PAGE
.CENTER;RTRHED.MAC
;
; RTRHED
;	Routing database header offset definition.
;
; Date of last update:  03/04/87
; Author: Earl Lakia
;
	.MACRO	RTRHED
	.ASECT
 .=0
HD.NOD:	.BLKB	6	; OUR NODE NAME
HD.ID:	.BLKW	1	; WILL CONTAIN UNIQUE IDENTIFIER
			; SO CAN TELL IF DATABASE CHANGES
HD.STR: .BLKW   1	; WILL CONTAIN '1' AFTER ROUTER 
			; STARTED SO THAT ROUTER CAN'T BE 
			; RESTARTED WITHOUT REINSTALLING
			; DATABASE
HD.NRB:	.BLKW	1	; NRB BEGINNING THREAD
HD.NBL:	.BLKW	1	; LAST NRB SCANNED FOR OUTPUT
HD.NCT:	.BLKW	1	; NUMBER OF NRBS (NODES)
HD.NRT: .BLKW	1	; NOT ROUTABLE TIMER FLAG (1= TIMER
			;  ACTIVE)
HD.CTM:	.BLKW	1	; CONNECT TIMER FLAG (1= CONNECT 
			; TIMER ACTIVE)
HD.OBF:	.BLKW	1	; POINTER TO OUTPUT BUFFERS
HD.BLS: .BLKW	1	; POINTER TO NEXT POSSIBLE 
			; AVAILABLE OUTPUT BUFFER
HD.OCT:	.BLKW	1	; TOTAL NUMBER OF OUTPUT BUFFERS
HD.BFR: .BLKW	1	; NUMBER OF FREE OUTPUT BUFFERS
HD.OSZ:	.BLKW	1	; SIZE OF OUTPUT BUFFER
HD.RBF:	.BLKW	1	; POINTER TO RESPONSE BUFFERS
HD.RLS: .BLKW	1	; POINTER TO NEXT POSSIBLE 
			; AVAILABLE RESPONSE BUFFER
HD.RCT:	.BLKW	1	; TOTAL NUMBER OF RESPONSE BUFFERS
HD.RFR: .BLKW	1	; NUMBER OF FREE RESPONSE BUFFERS
HD.RSZ:	.BLKW	1	; SIZE OF RESPONSE BUFFER
 .=0
	.ENDM
.PAGE
.CENTER;STADEF.MAC
;
; STADEF
;	Connect/disconnect status message written to queue 
;	offset definition
;
; Date of last update:  3/17/87
;
	.MACRO	STADEF
	.ASECT
 .=0
SM.PRI:	.BLKB	6	; PRIMARY NODE NAME FROM DATABASE
SM.SEC:	.BLKB	6	; SECONDARY NODE NAME FROM DATABASE
SM.IOS:	.BLKW	1	; STATUS OF CONNECT/DISCONNECT
SM.UD:	.BLKW	1	; CONNECT/DISCONNECT FLAG 
			; (0=DISCONNECT, 1=CONNECT)
SM.STS:	.BLKW	2	; NRB STATUS WORD FROM DATABASE 
			; (ONLY FIRST WORD USED)
SM.LEN=.
 .=0
	.ENDM
.AX ROUTING DATABASE MACROS
.FILL
	The following single macro defines all of the macros needed
to generate the actual routing database required by the router.  The
reader should consult the main body of the document (ROUTING TASK Chapter)
for the parameters for the actual calls.  The actual source
code for the macro is only included here to help decode any errors
that might occur while developing a routing database.
.page
.nofill
;
; ROUTING DATABASE MACROS
;
; DATE OF LAST UPDATE:  6/8/87
;
;  6/8/87- Modified Node macro to add save buffer 
;          for network connect request messages.
; 		D.J.L.
;  3/4/87- Modified Node macro to add LOG parameter to 
;	   support logical node names.
;		D.J.L.
;  2/5/87- Modified Node macro to change default access 
; 	   control string to MA_ROUTER instead of 
;	   <TASK=MA_ROUTER`>.
;	   	E.D.L.
;
; AUTHOR:  Earl Lakia
;
;
; Main routing macro, defines all others and header
; of the routing database
;
 .MACRO	RTRDEF,MXSZ,MXOT,MXRS
;
; RTRDEF MACRO
; This macro is responsible for the following:
; 	1) Defining additional macros for the node and route
;	   definitions.
;	2) Defining the largest outbound message buffer size
;	   (default is 512).
;	3) Defining the number of outbound messages to
; 	   be outstanding at one time (default=4).
;	4) Defining the number of response buffers for
;	   acknowledging inbound messages (default=
;	   MXOT*2)
;
;	MXSZ= Largest outbound message size in bytes
;	MXOT= Number of outstanding outbound messages
;	MXRS= Number of response message buffers.
;
 .IIF DF,RT$DEF,.ERROR ;MULTIPLE CALL OF THE RTRDEF MACRO
;
; SET DEFAULTS IF BLANK ARGUMENTS
;
 .IF B MXOT
	MXOTX=4	  	; DEFAULT NUMBER OUTPUT BUFFERS
 .IFF 
	MXOTX=MXOT
 .ENDC
;
 .IF B MXSZ
	MXSZX=512.	; DEFAULT SIZE OF OUTPUT BUFFER
 .IFF 
	MXSZX=MXSZ
 .ENDC
;
 .IF B MXRS
	MXRSX=MXOTX*2 	; DEFAULT NUMBER OF RESPONSE BUFFERS
 .IFF 
	MXRSX=MXRS
 .ENDC
;
 .MCALL	CONB$$		; CONNECT BLOCK MACRO
 .MCALL NETDF$		; NETWORK OFFSETS
 .MCALL	NRBDEF		; INVOKE NRB MACRO TO GET LOGICAL 
 			;   NAME STATUS BIT VALUE
 .MCALL	MGHDEF,HDRDEF	; EVOKE MACROS TO GET ROUTER AND 
			;   QUEUE HEADER SIZES
 .NLIST	ME
NETDF$
MGHDEF
HDRDEF
NRBDEF
 .LIST	ME
;
NDCNT=0		; NUMBER OF NODES DEFINED SO FAR.
TIDCNT=0	; NUMBER OF MSG ID'S DEFINED (ALL NODES)
MXSZX=MXSZX+MG.SIZ+H.SIZ   ; ADD IN ROUTER AND 
			   ; QUEUE HEADER SIZES 
RSPSIZ=44.	; SIZE OF A RESPONSE BUFFER
;
; HEADER OF THE WHOLE ROUTING DATABASE
;
 .PSECT ARTRHD,RW,D,OVR,REL,GBL
;
HD.NOD:	.ASCII	/******/	; OUR NODE NAME
HD.ID:	.BLKW	1	; WILL CONTAIN UNIQUE IDENTIFIER
			; SO CAN TELL IF DATABASE CHANGES
HD.STR:	.WORD	0	; WILL CONTAIN '1' AFTER ROUTER 
			; STARTED SO THAT ROUTER CAN'T BE 
			; RESTARTED WITHOUT REINSTALLING 
			; DATABASE
HD.NRB:	.WORD	NODE0	; NRB BEGINNING THREAD
HD.NBL:	.WORD	NODE0	; LAST SCANNED NRB, INIT TO ZERO
HD.NCT:	.WORD	0	; NUMBER OF NRBS (NODES)
HD.NRT:	.WORD	0	; NOT ROUTABLE TIMER FLAG 
			; (1= TIMER ACTIVE)
HD.CTM:	.WORD	0	; CONNECT TIMER FLAG 
			; (1= CONNECT TIMER ACTIVE)
HD.OBF:	.WORD	OUTBUF	; POINTER TO OUTPUT BUFFERS
HD.BLS: .WORD	OUTBUF	; POINTER TO NEXT POSSIBLE 
			; AVAILABLE OUTPUT BUFFER
HD.OCT:	.WORD	MXOTX	; TOTAL NUMBER OF OUTPUT BUFFERS
HD.BFR: .WORD	MXOTX	; NUMBER OF FREE OUTPUT BUFFERS
HD.OSZ:	.WORD	MXSZX	; SIZE OF OUTPUT BUFFER
HD.RBF:	.WORD	RSPBUF	; POINTER TO RESPONSE BUFFERS
HD.RLS: .WORD	RSPBUF	; POINTER TO NEXT POSSIBLE 
			; AVAILABLE RESPONSE BUFFER
HD.RCT:	.WORD	MXRSX	; TOTAL NUMBER OF RESPONSE BUFFERS
HD.RFR: .WORD	MXRSX	; NUMBER OF FREE RESPONSE BUFFERS
HD.RSZ:	.WORD	RSPSIZ	; SIZE OF RESPONSE BUFFER
;
; OUTPUT BUFFERS
;
 .PSECT OUTBUF,D,RW,REL,OVR,GBL
;
OUTBUF:
I=1
 .REPT	MXOTX
 .IF EQ <I-MXOTX`>
	.WORD	OUTBUF	; NO MORE BUFFERS, POINT BACK 
			; TO FIRST BUFFER
	.WORD	0,0,0	; NRB, AND STATUS BLOCK OF NODE 
			; USING THIS BUFFER
 .IFF
	.WORD	.+MXSZX+12 ; LINK TO NEXT BUFFER HEADER
	.WORD	0,0,0	; NRB, AND STATUS BLOCK OF 
			; NODE USING THIS BUFFER
 .ENDC
	.BLKB	MXSZX	; ALLOCATE THE BUFFER
	I=I+1
 .ENDR
;
; RESPONSE BUFFERS
;
 .PSECT RSPBUF,D,RW,REL,OVR,GBL
RSPBUF:
I=1
 .REPT	MXRSX
 .IF EQ <I-MXRSX`>
	.WORD	RSPBUF	; NO MORE BUFFERS, POINT BACK TO 
			; FIRST BUFFER
	.WORD	0,0,0	; NRB, AND STATUS BLOCK OF NODE 
			; USING THIS BUFFER
 .IFF
	.WORD	.+RSPSIZ+12 ; LINK TO NEXT BUFFER HEADER
	.WORD	0,0,0	; NRB, AND STATUS BLOCK OF NODE 
			; USING THIS BUFFER
 .ENDC
	.BLKB	RSPSIZ	; ALLOCATE THE RESPONSE BUFFER
	I=I+1
 .ENDR
.PAGE
; 
; UTILITY MACROS
;
; MACRO TO CREATE A LABEL
; 
 .MACRO LABEL,NAME
NODE'NAME:
 .ENDM
;
; MACRO TO GENERATE A LABEL TO POINT BACK TO THE START OF 
; A THREADED LIST
;
 .MACRO ELABEL,NAME
NODE'NAME = NODE0	; ENDING LINK
 .ENDM
;
; MACRO TO GENERATE A LINK TO NEXT NRB
;
 .MACRO FLINK,LNK
	.WORD	NODE'LNK	; LINK TO NEXT NRB
 .ENDM
;
; MACRO TO GENERATE A INPUT BUFFER AND GENERATE LINKS
;
 .MACRO	UNSBUF,NODE,SIZ
	.WORD	USBF'NODE	; LINK TO UNSOLICITED INPUT 
				; BUFFER
	.SAVE
 .PSECT	UNSBUF,D,RW,REL,OVR,GBL
	.EVEN
USBF'NODE:
	.WORD	SIZ	; SIZE OF THE BUFFER
	.BLKB	SIZ	; ACTUAL BUFFER
	.RESTORE
 .ENDM
;
.PAGE
;
; NODE MACRO
;	This macro builds a Node Routing Block (NRB).
;
;  LOG= Flag.. Primary node name is a logical node name
;  PRI= Primary node name (or Blank if terminating macro)
;  SEC= Secondary node name
;  ACC= Access control string (Default= MA_ROUTER)
;  SIZ= Largest incoming message size in bytes 
;       (Default=512 bytes)
;
; calling sequence:
;	NODE LOG,PRI=<B4750A`>,SEC=<B4750B`>,
;	     ACC=<<MA_ROUTER`>`>,SIZ=1024.
;
 .MACRO NODE,LOG,PRI,SEC,ACC,SIZ
IDCNT=0				; NUMBER IDs FOR THIS NODE
 .IF B PRI
	ELABEL	\NDCNT		; CREATES NULL FORWARD LINK
	RTRDID==<NDCNT*1000`>+<TIDCNT`> ; GLOBAL SYMBOL USED
				      ;   BY ROUTER PGM
				      ;   TO CHECK IF IT IS
				      ;   USING CURRENT 
				      ;   ROUTING DATABASE
	.PSECT	ARTRHD
	SAVEPC=.		; SAVE PSECT PROGRAM COUNTER
	.=HD.ID
	.WORD	RTRDID		; REPLACE HD.ID IN HEADER 
				; TO IDENTIFY DBS
	.=HD.NCT
	.WORD	NDCNT		; REPLACE HD.NCT IN HEADER
	.=SAVEPC		; RESTORE PSECT PROGRAM 
				; COUNTER
	.MEXIT
 .ENDC
;
; BUILD A NRB AS WE HAVE A NODE SPECIFIED
;
 .PSECT	NRBS,D,OVR,RW,REL,GBL
;
	LABEL	\NDCNT	; DEFINE OURSELVES
	LUN=NDCNT+4	
	.WORD	LUN	; LOGICAL UNIT NUMBER USED TO 
			; CONNECT TO NODE
	.IF NB LOG
	.WORD	NS.LND	; SET LOGICAL NODE NAME STATUS BIT
	.IFF
	.WORD	0	; N.STS NODE STATUS
	.ENDC
	NDCNT=NDCNT+1	; INCREMENT NUMBER OF NODES BEING 
			; DEFINED
	FLINK	\NDCNT  ; LINK TO NEXT NRB
	.BLKB	6	; ACTUAL CURRENT NODE NAME (FILLED 
			; IN WHEN CONNECTED)
LIM=.+6			; ONLY TAKE 6 CHARACTER NODE NAME
	.ASCII	/'PRI/
 .=LIM
LIM=.+6			; ONLY TAKE 6 CHARACTER SEC. NODE 
			; NAME
	.IF NB LOG 
	.ASCII	/      /
	.IFF 
	.IF B SEC
	.ASCII	/'PRI/	; IF NO SECONDARY, THEN USE PRIMARY
	.IFF
	.ASCII	/'SEC/
	.ENDC
	.ENDC
 .=LIM
	.ASCII	/                              / ; INIT ACC
	.ASCII	/                              / ; TO BLANKS
 .=LIM
LIM=.+60.		; ONLY ALLOW 60 CHARACTER ACCESS 
			; CONTROL STRING
	.IF B <ACC`>
	.ASCII	/MA_ROUTER/	; DEFAULT ACCESS 
					; CONTROL STRING
	.IFF
	.ASCII	/'ACC/	; ACCESS CONTROL STRING
	.ENDC
 .=LIM
	.NLIST	ME
	.IF B <ACC`>
	CONB$$	,0,1,<MA_ROUTER`>  ; BUILD DEFAULT 
				       ; NETWORK CONNECT 
				       ; BLOCK
	.IFF
	CONB$$	,0,1,ACC	;BUILD NETWORK CONNECT BLOCK
	.ENDC
	.LIST	ME
NIDCNT=.		; SAVE FOR REPLACEMENT BY ROUTE 
			; MACRO 
	.WORD	0	; TOTAL ID'S THIS NODE FROM ROUTE 
			; MACRO
	.IF B SIZ
	SIZX=512.	; DEFAULT SIZE OF UNSOLICITED 
			; INPUT BUFFER
	.IFF 
	SIZX=SIZ
	.ENDC
	SIZX=SIZX+MG.SIZ+H.SIZ	; ADD IN ROUTER AND QUEUE 
				; HEADER SIZES
	UNSBUF	\NDCNT-1,SIZX	; LINK TO UNSOLICITED INPUT
				; BUFFER AND ALSO ALLOCATE 
				; BUFFER
	.WORD	.+2	; N.IBSA ADDRESS OF NETWORK RECEIVE
			; I/O STATUS BLOCK
	.WORD	0,0	; N.IOSB NETWORK RECEIVE I/O STATUS 
			; BLOCK
	.WORD	.+2	; N.ISAC ADDR OF CONNECT/DISCONNECT
			; I/O STATUS BLOCK
	.WORD	0,0	; N.IOSC CONNECT/DISCONNECT I/O 
			; STATUS BLOCK
	.WORD	.+2	; N.ISAU ADDRESS OF NETWORK DATA 
			; I/O STATUS BLOCK
	.WORD	0,0	; N.IOSU NETWORK DATA I/O STATUS 
			; BLOCK
	.WORD	0	; N.SEQ LINK SEQUENCE INBOUND NUMBER
	.WORD	0	; N.OSEQ LINK SEQUENCE OUTBOUND 
			; NUMBER
	.WORD	.+4+N.CBL+30  ; N.OIDS ADDRESS LAST SCANNED 
			      ; OUTBOUND NRBID 
	.WORD	0	; N.STAM CONNECT/DISCONNECT STATUS 
			; FOR WRITE TO QUEUE
        .BLKB	N.CBL+30 ; N.MBX SAVE BUFFER FOR NETWORK 
                         ;   CONNECT REQUEST MESSAGE
 .ENDM
.PAGE
;
; The following macro performs the routing function for
; an outbound message id.
;
;	ID= Message Id that is to be output. If less
;	    than 16 characters are specified, it is
;	    padded with Blanks.
;
;	If the ID is Blank, it terminates a list of
;	ROUTE macros for a particular node.
;
; Calling sequence:
;
;	ROUTE  ID=<MESSAGE_ID`>
;
 .MACRO ROUTE,ID
;
 .PSECT	NRBS,D,OVR,RW,REL,GBL
 .IF B ID
	.WORD	0		; INDEX FOR QUEUE
	.WORD	0		; RNA
	.WORD	0		; MSG ID STATUS WORD
	.ASCII	/                /  ; END MESSAGE ID
	SAVEPC=.
	.=NIDCNT		    ; RESET PC TO NUMBER OF
				    ;  IDs IN NRB
	.WORD	IDCNT		    ; STORE NUMBER OF IDs
	.=SAVEPC
	TIDCNT=TIDCNT+IDCNT	    ; ADD TO TOTAL NUMBER 
				    ;  OF ID'S
	.MEXIT
 .ENDC	
;
; Attach the message id to the current node being defined
;
	.WORD	0		; INDEX FOR QUEUE
	.WORD	0		; RNA
	.WORD	0		; MSG ID STATUS WORD
	LIM=.
	.ASCII	/                /	; INIT TO Blanks
	.=LIM	
	LIM=.+16.		; DON'T LET GET BIGGER 
				; THAN 16
	.ASCII	/'ID/
	.=LIM
	IDCNT=IDCNT+1		; INCREMENT NUMBER OF MSG 
				; ID'S THIS NODE
 .ENDM
 .ENDM
.AX ERROR CODES
.FILL
.hl 1 ERRORS RETURNED BY DRIVER/ACP
	The following error codes are returned by either the ZQ driver
or the QUEACP to the task that issued the I/O request.  The 
.x QUEACP Task>Referenced
.x ZQ Driver>Referenced
error code indicates why the I/O request issued could not be completed.
.SK 3
.list 1 ' '
.le;IE.IFC (-02) -- Invalid function code.  The I/O function specified in 
the QIO could not be processed by the ZQ driver or the ACP.
.x IE.IFC>Defined
.le;IE.SPC (-06) -- Bad buffer address.
.x IE.SPC>Defined
.le;IE.DNA (-07) -- ZQ: device not mounted.
.X IE.DNA>Defined
.le;IE.DUN (-09) -- ZQ: device not mounted or marked for dismount.
.x IE.DUN>Defined
.le;IE.EOF (-10) -- No messages in queue.
.x IE.EOF>Defined
.le;IE.WLK (-12) -- A connect request has been received from a task that
does not have a pending I/O.  Subroutine INITQ was probably not called
to set up the task exit handlers.
.x INITQ Subroutine>Referenced
.X IE.WLK>Defined
.le;IE.DAO (-13) -- User buffer to small to contain message read.
.x IE.DAO>Defined
.le;IE.ABO (-15) -- QUEACP has been aborted via directive or an MCR or
DCL command.
.x IE.ABO>Defined
.le;IE.PRI (-16) -- The ZQ: device is not mounted.  
.x IE.PRI>Defined
.le;IE.LCK (-27) -- Trying to mount ZQ: device when already mounted; trying
to dismount ZQ: device when already dismounted.
.x IE.LCK>Defined
.le;IE.CKS (-30) -- Error reading queue header into queue region.
.x IE.CKS>Defined
.le;IE.WAT (-31) -- Queue file not contiguous.
.x IE.WAT>Defined
.le;IE.SNC (-35) -- The wrong message is being acknowledged.
.x IE.SNC>Defined
.le;IE.CLO (-38) -- Error closing the queue file.
.x IE.CLO>Defined
.le;IE.NBF (-39) -- Directive error reading queue header from queue file.
.x IE.NBF>Defined
.le;IE.RBG (-40) -- Message to be written to queue exceeds 4014 bytes.
.x IE.RBG>Defined
.le;IE.NBK (-41) -- Queue header larger than 4K words; cannot map with 
a single APR.
.x IE.NBK>Defined
.le;IE.ILL (-42) -- The ACP is not installed in the system.
.x IE.ILL>Defined
.le;IE.RCN (-46) -- I/O error reading queue header from queue file.
.x IE.RCN>Defined
.le;IE.FOP (-53) -- A message exists in the queue that has been read
but not acknowledged.
.x IE.FOP>Defined
.le;IE.NFW (-69) -- ACP not found in system task directory when trying to
mount ZQ: device.
.x IE.NFW>Defined
.le;IE.PNT (-71) -- No message in this queue needs to be acknowledged.
.x IE.PNT>Defined
.le;IE.NDR (-72) -- No room left in queue.
.x IE.NDR>Defined
.le;IE.URJ (-73) -- Task cannot connect to queue; other task already
connected.
.x IE.URJ>Defined
.le;IE.NLK (-79) -- Task is not connected to queue; cannot read any
messages until connected.
.x IE.NLK>Defined
.le;IE.NST (-80) -- Another task is connected to queue; cannot read
any messages while other task connected.
.x IE.NST>Defined
.le;IE.IQU (-91) -- Trying to mount ZQ: device with a task that is not 
marked as an ACP.
.x IE.IQU>Defined
.LE;IE.UKN (-97) -- Message id does not exist.
.x IE.UKN>Defined
.els
.page
.hl 1 ACP ERRORS
	If the ACP terminates abnormally (ie. an SST occurs) during 
execution, the message 
.lit

	hh:mm:ss  *** ZQ0:  -- Select error

.eli
will be printed.  A PMD (Postmortem Dump), QUEACP.PMD, is generated in 
LB0:[1,4].  This PMD may be useful in solving the problem and should
be saved.
	The following errors are output to the console logger by the ACP,
QUEACP.  Any error marked 'FATAL' will cause the ACP to exit.  No PMD is 
.x QUEACP Task>Referenced
generated.  The format of the ACP error message is:
.lit

   date time (ii) QUEACP QUEUE MANAGER ERROR: nn STATUS: nnnn

		where
			date = current date in the form dd-mmm-yy
			time = current time in the form hh:mm:ss
			  ii = number of error messages lost
			       (not logged) since last log
			  nn = error number
			nnnn = status
.eli
.SK 3
.list 1 ' '
.x MAQUEUE.DAT File>Referenced
.le;ERROR 01 - The queue file MAQUEUE.DAT is not contiguous.  The file
must be contiguous for the ACP to access it.  No status is displayed.
.le;ERROR 02 - The ACP is unable to open the queue file MAQUEUE.DAT.  The
returned FCS error code is the displayed status.
.le;ERROR 03 - (FATAL) An I/O error occurred while the ACP was attempting to 
read or write one block (512 bytes) of a message.  The 
returned RSX I/O error code is the displayed status.
.le;ERROR 04 - The ACP received a bad directive status while attempting
to create the queue header region QUEHED.  The displayed status is the 
directive status.
.x QUEHED Region>Referenced
.le;ERROR 05 - The ACP received a bad directive status while attempting
to create the address window to map the queue header region QUEHED.  The 
displayed status is the directive status.
.x QUEHED Region>Referenced
.le;ERROR 06 - The queue header region QUEHED has been created and mapped
successfully.  The displayed status is the size of the region in 32 word 
blocks.
.x QUEHED Region>Referenced
.le;ERROR 07 - The header of the queue is over 8K bytes and cannot, therefore,
be mapped by the ACP with one APR.  The size of the queue header must be reduced
by either deleting an appropriate number of message ids or reducing the number
of message blocks in the queue.  Deleting one message id will reduce the size
of the header by 44 bytes.  Reducing the size of the queue by 16 message blocks
will reduce the size of the header by one word.  The displayed status is the 
size of the current queue header in 32 word blocks.
.x MAQUEUE.DAT File>Referenced
.le;ERROR 08 - The ACP received a bad directive status while attempting to 
read the the queue header from the queue file MAQUEUE.DAT into the queue header
region QUEHED.  The displayed status is the directive status.
.x QUEHED Region>Referenced
.x MAQUEUE.DAT File>Referenced
.le;ERROR 09 - An I/O error occurred while the ACP was attempting to 
read the the queue header from the queue file MAQUEUE.DAT into the queue header
region QUEHED.  The returned RSX I/O error code is the displayed status.
.x QUEHED Region>Referenced
.x MAQUEUE.DAT File>Referenced
.le;ERROR 10 - The ACP is unable to close the queue file MAQUEUE.DAT.  The
returned FCS error code is the displayed status.
.x MAQUEUE.DAT File>Referenced
.le;ERROR 11 - The ACP received a bad directive status while attempting to
write the queue header (in region QUEHED) to the queue file MAQUEUE.DAT.  The
displayed status is the directive status.
.x QUEHED Region>Referenced
.x MAQUEUE.DAT File>Referenced
.le;ERROR 12 - An I/O error occurred while the ACP was attempting to 
write the queue header (in region QUEHED) to the queue file MAQUEUE.DAT.  The 
returned RSX I/O error code is the displayed status.
.x QUEHED Region>Referenced
.le;ERROR 13 - The end of the queue was encountered while deleting a type zero 
message when the type zero message count (M.NVC) was not equal to zero.  The 
virtual address of the beginning of the offending message id listhead is the 
displayed status.  The message id name is also logged.
.le;ERROR 14 - The ACP received a bad directive status while attempting to 
detach from the queue header region QUEHED.  The displayed status is the 
directive status.
.x QUEHED Region>Referenced
.le;ERROR 15 - The ACP has been aborted via an abort directive or a DCL or MCR 
command.  The status displayed is 'ABORT'.
.le;ERROR 16 - (FATAL) The ACP received a bad directive status while attempting
to specify an AST abort routine.  The displayed status is the directive status.
.le;ERROR 17 - (FATAL) The ACP received a bad directive status while attempting
to specify an SST vector.  The displayed status is the directive status.
.x MAQUEUE.DAT File>Referenced
.le;ERROR 18 - The ACP received a bad directive status while attempting to 
read the first block of the queue header from the queue file MAQUEUE.DAT. 
The ACP needs information in this header block to calculate the size of the
header region QUEHED.  The displayed status is the directive status.
.x QUEHED Region>Referenced
.x MAQUEUE.DAT File>Referenced
.le;ERROR 19 - An I/O error occurred while the ACP was attempting to read
the first block of the queue header from the queue file MAQUEUE.DAT. 
The ACP needs information in this header block to calculate the size of the
header region QUEHED.  The returned RSX I/O error code is the displayed status.
.x QUEHED Region>Referenced
.le;ERROR 99 - The ACP has been activated.  It will remain in a 'wait state'
until it receives an I/O packet from the ZQ driver.  The status displayed is
'START'.
.els
.page
.hl 1 ROUTER ERRORS
	If the Router terminates abnormally (ie. an SST occurs) during 
execution, the message 
.lit

	hh:mm:ss  Task "RTRRSX" terminated
		  Task exit with outstanding I/O

.eli
will most likely be printed.  A PMD (Postmortem Dump), RTRRSX.PMD, is generated 
in LB0:[1,4].  This PMD may be useful in solving the problem and should
be saved.
	The following errors are output to the console logger by the Router
task, RTRRSX.  Any error marked 'FATAL' will cause the Router to exit.  No PMD 
.x RTRRSX Task>Referenced
is generated.  The format of the Router error message is:
.lit

   date time RTRRSX ROUTER ERROR: nn STATUS: nnn   mmm    node

		where
			date = current date in the form dd-mmm-yy
			time = current time in the form hh:mm:ss
			  nn = error number
			 nnn = status
			 mmm = additional status information
			node = a node name
.eli
.SK 3
.list 1 ' '
.le;ERROR 01 - (FATAL) The Router received a bad directive status while 
attempting to specify an SST vector.  The displayed status is the directive 
status.
.le;ERROR 02 - (FATAL) The Router received a bad directive status while 
attempting to attach to the queue header region QUEHED created by the ACP.  
The displayed status is the directive status.
.x QUEHED Region>Referenced
.le;ERROR 03 - (FATAL) The Router received a bad directive status while 
attempting to create the address window to map the queue header region QUEHED.  
The displayed status is the directive status.
.x QUEHED Region>Referenced
.le;ERROR 04 - The queue header region QUEHED has been attached and mapped
successfully.  The displayed status is the size of the region in 32 word 
blocks.
.x QUEHED Region>Referenced
.le;ERROR 05 - (FATAL) The Routing Database RTRDBS is not consistent with the 
database linked to the Router.  The displayed status is the id of the database 
linked to the Router.  Rebuild both the Router and the Routing Database.
.x RTRDBS Routing Database>Referenced
.le;ERROR 06 - (FATAL) The Router received a bad directive status while 
attempting to assign a LUN for network access.  The displayed status is the 
directive status.
.le;ERROR 07 - (FATAL) The Router received a bad directive status while 
attempting to specify the AST routine to handle AST's from the network. The 
displayed status is the directive status.
.le;ERROR 08 - (FATAL) An I/O error occurred while the Router was attempting to 
specify the AST routine to handle AST's from the network.  The returned 
DECNET I/O error code is the displayed status.
.le;ERROR 09 - (FATAL) The Router received a bad directive status while 
attempting to get the local node information.  The displayed status is the 
directive status.
.le;ERROR 10 - (FATAL) An I/O error occurred while the Router was attempting 
to get the local node information.  The returned DECNET I/O error code is the 
displayed status.
.le;ERROR 11 - (FATAL) An I/O error occurred while the Router was attempting to
assign a LUN for network access.  The returned DECNET I/O error code is the 
displayed status.
.le;ERROR 12 - The Router received a message in its network data queue that did
not have a defined network message type.  The undefined type is the displayed
status.
.le;ERROR 13 - (FATAL) The Router received a bad directive status while 
attempting to place a read but not acknowledged message at the front of its
message id subqueue immediately after a logical link was established.  The 
displayed status is the directive status.
.le;ERROR 14 - The Router has successfully connected to the network.  No status
is displayed, but the local node name is printed.
.le;ERROR 15 - The Router rejected a logical link connect request from a 
remote node.  No status is displayed if an I/O error did not occur on the
rejection.  The name of the node that requested the connection is displayed.
.le;ERROR 16 - An I/O error occurred while the Router was attempting to 
accept the logical link connect request from a remote node.  The DECNET I/O
error code is the displayed status.  The name of the node requesting the 
connection is also displayed.  A timer will be started so that a connect 
with the node may be attempted later.
.le;ERROR 17 - The Router received a bad directive status while attempting to
accept the logical link connect request from a remote node.  The displayed
status is the directive status.  The name of the node requesting the connection
is also displayed.
.le;ERROR 18 - The Router received a bad directive status while attempting to
reject a logical link connect request from a remote node. The displayed
status is the directive status.
.le;ERROR 19 - The Router received in its network data queue an interrupt
message.
.le;ERROR 20 - The Router received in its network data queue a user disconnect 
message.  No status is displayed, but the name of the node whose Router issued
the disconnect is displayed.  A timer will be started so that a connect with the
node may be attempted later.
.le;ERROR 21 - The Router received in its network data queue a user abort 
message.  No status is displayed, but the name of the node whose Router issued
the abort is displayed.  A timer will be started so that a connect with the
node may be attempted later.
.le;ERROR 22 - The Router received in its network data queue a network abort 
message.  The DECNET error code (see Appendix A of the DECnet-RSX Programmer's
Reference Manual) is displayed.  The name of the node that
had its logical link with this node aborted by the network is also displayed.
A timer will be started so that a connect with the node may be attempted
later.
.le;ERROR 23 - An I/O error occurred while the Router was attempting to 
get data from the network data queue.  The returned DECNET I/O error code is 
the displayed status.
.le;ERROR 24 - The Router received a request in its network data queue for
a logical link connection to a node not defined in the Router Database RTRDBS.
The connect request is rejected by the Router.  No status is displayed, but
the name of the node requesting the connection is displayed.  To accept
the connect request, define the name of the requesting node in the database.
If the requesting node is associated with a logical node name, Program
FNDSRV will complete the translation so that a connection may be attempted
later.
.x FNDSRV Task>Referenced
.x RTRDBS Routing Database>Referenced
.le;ERROR 25 -  A logical link connection has been established between
the Router and the Router on a remote node.  No status is displayed.
The name of the remote node is displayed.
.le;ERROR 26 - The Router was attempting to connect to a message id not in
the queue.  The message id must be defined in the queue before any messages
written to the message id subqueue can be routed to another node.  No status
is displayed, but the offending message id is displayed.
.le;ERROR 27 - The Router received a bad directive status while attempting to
post a read on a remote node.  This read is posted so that a message can be 
received over an established logical link from the Router on a remote node.
The displayed status is the directive status.  The name of the remote node 
that will be sending the message is also displayed.  The Router will disconnect
the logical link if it is not already disconnected.
.le;ERROR 28 - An I/O error occurred while the Router was attempting to 
receive (read) a message sent by a remote node.  The returned DECNET I/O
error code is the displayed status.  The name of the node that sent the message
is also displayed.  The Router will disconnect the logical link if it is not
already disconnected.
.le;ERROR 29 - The link sequence number received from a remote node does not
agree with the link sequence number in the database for this node.  This
error usually occurs when the remote system is booted or a previously sent
message is never received.  In any case, the link sequence number received
from the remote is accepted as the new link sequence number by the Router.
The difference between the two link sequence numbers is the displayed status.
The remote node name is also displayed.
.le;ERROR 30 - The Router received a bad directive status while attempting to
write a message received from a remote node to its message id subqueue on this
node.  The displayed status is the directive status.  
The name of the message id subqueue that the message
was to be written to is also displayed.  The Router will disconnect the 
logical link if it is not already disconnected.
.le;ERROR 31 - The Router received an invalid router message from the remote
note.  This router message is the response sent by the remote node after
it receives the message this node sent.  The only valid message types sent
in the router message are types -1, -2, and -3.  Any other type is invalid
and displayed as the status.  The name of the remote node is also displayed.
.le;ERROR 32 - The RNA (read not acknowledged) id received from a remote node
does not match the id assigned when the Router read the message from a
message id subqueue on this node.  
Unless the two RNA ids match, the Router cannot delete the
message from the subqueue, thereby acknowledging that the remote node received
the message.  The RNA id received from the remote node is the displayed status.
The name of the message id subqueue from which the message was read is also
displayed.  This error will cause the read but not acknowledged message to
remain in the message id subqueue indefinitely.  All messages queued behind
it will not be sent to a remote node until this message is acknowledged
or deleted; the QMT delete message function may be used to do this.
.x QMT Task>Referenced
.le;ERROR 33 - The Router received a bad directive status while attempting to
acknowledge a message that it sent to a remote node.  
This error occurred when the Router received
a response from the remote node indicating that the message was successfully
queued on the remote node and can now be deleted completely from its
message id subqueue on this node.  The displayed 
status is the directive status.  The name of the 
message id subqueue from which the message is now to be deleted is also
displayed.  This error will cause the read but not acknowledged message to
remain in the message id subqueue indefinitely.  All messages queued behind
it will not be sent to a remote node until this message is acknowledged
or deleted; the QMT delete message function may be used to do this.
.x QMT Task>Referenced
.le;ERROR 34 - (FATAL) The Router received a bad directive status while 
attempting to connect to a message id in the queue.  The displayed status is 
the directive status.
.le;ERROR 35 - (FATAL) An I/O error occurred while the Router was attempting to 
connect to a message id in the queue.  The returned DRIVER/ACP I/O error 
code is the displayed status.
.le;ERROR 36 - An I/O error occurred while the Router was attempting to 
place a message, sent to a remote node, back at the front of its message id 
subqueue on this node.  This error occurred when 
the Router received a response from the remote node indicating 
that the remote could not queue the message it received from this node.
The returned DRIVER/ACP I/O error code is the displayed status.  The name of 
the message id subqueue is also displayed.
This error will cause the read but not acknowledged message to
remain in the message id subqueue indefinitely.  All messages queued behind
it will not be sent to a remote node until this message is requeued
or deleted; the QMT delete message function may be used to delete the message
and Program TSTACP may be used to requeue the message.
.x TSTACP Task>Referenced
.x QMT Task>Referenced
.le;ERROR 37 - An I/O error occurred while the Router was attempting to 
acknowledge a message that it sent to a remote node.  
This error occurred when the Router received
a response from the remote node indicating that the message was successfully
queued on the remote node and can now be deleted completely from its 
message subqueue on this node.
The returned DRIVER/ACP I/O error code is the displayed status. 
The name of the message id subqueue is also displayed.
This error will cause the read but not acknowledged message to
remain in the message id subqueue indefinitely.  All messages queued behind
it will not be sent to a remote node until this message is acknowledged
or deleted; the QMT delete message function may be used to do this.
.x QMT Task>Referenced
.le;ERROR 38 - The Router received a bad directive status while attempting to
get data from the network data queue.  The displayed status is the directive 
status.
.le;ERROR 39 - An I/O error occurred while the Router was attempting to 
send a message to a remote node.  The returned DECNET I/O error code is 
the displayed status.  The remote node name is also displayed.  The Router
will disconnect the logical link if it is not already disconnected.
.le;ERROR 40 - (FATAL) The Router was unable to allocate an output buffer (a 
buffer that holds a message after it is read from the queue and before it is
sent to a remote node) when there were buffers available.  An IOT is executed
so that a PMD can be generated.  No status is displayed.
.le;ERROR 41 - The Router received a bad directive status while attempting to
read a message from a message id subqueue so that it could be sent to a remote 
node.  The displayed status is the directive status.  The name of the message 
id subqueue from which the message was read is also displayed.  The messages 
in this message id subqueue will not be sent to a remote node until the Router 
is restarted by invoking STARTR.CMD.
.le;ERROR 42 - An I/O error occurred while the Router was attempting to 
read a message from a message id subqueue so that it could be sent to a remote 
node.  The returned DRIVER/ACP I/O error code is the displayed status.  The 
name of the message id subqueue from which the message was read is also 
displayed.  The messages in this message id subqueue will not be sent to a 
remote node until the Router is restarted by invoking STARTR.CMD.
.le;ERROR 43 - The Router received a bad directive status while attempting to
send a message to a remote node.  The displayed status is the directive 
status.  The remote node name is also displayed.  The Router will disconnect
the logical link if it is not already disconnected.
.le;ERROR 44 - The Router received a bad directive status while attempting to
place a message, sent to a remote node, back at the front of its message id
subqueue on this node.  This error occurred when the 
Router received a response from the remote node
indicating that the remote could not queue the message it received from this 
node.  The displayed status is the directive status.  The name of the 
message id subqueue is also displayed.
This error will cause the read but not acknowledged message to
remain in the message id subqueue indefinitely.  All messages queued behind
it will not be sent to a remote node until this message is requeued
or deleted; the QMT delete message function may be used to to delete the message
and Program TSTACP may be used to requeue the message.
.x TSTACP Task>Referenced
.x QMT Task>Referenced
.le;ERROR 45 - The Router received a bad directive status while attempting to
request a logical link connection with the Router on the node displayed.  The
displayed status is the directive status.
.le;ERROR 46 - The Router failed to create a logical link (make a connection)
with the node displayed.  The returned DECNET I/O error code is the displayed 
status.  If a second status is displayed, see Appendix A of the DECnet-RSX 
Programmer's Reference Manual for its meaning.
.le;ERROR 47 - An I/O error occurred while the Router was attempting to 
send a response to the remote node to acknowledge that it had received a 
message from the remote.  The returned DECNET I/O error code is the displayed 
status.  The name of the remote node is also displayed.  The Router will
disconnect the logical link if it is not already disconnected.
.le;ERROR 48 - The Router received a bad directive status while attempting to
send a response to the remote node to acknowledge that it had received a
message from the remote.  The displayed status is the directive 
status.  The remote node name is also displayed.  The Router will disconnect
the logical link if it is not already disconnected.
.le;ERROR 49 - The Router received a bad directive status while attempting to
issue a mark time.  The displayed status is the directive status.  The remote
node name or the message id name is also displayed.  The Router should be 
restarted by invoking STARTR.CMD since it could not start a timer to cause a 
later event to be performed.
.le;ERROR 50 - (FATAL) The Router received a bad directive status while 
attempting to set up the queue exit handler.  This exit handler (in the ACP) 
disconnects all of the subqueue message ids connected to the Router when the 
Router exits.  The displayed status is the directive status.
.le;ERROR 51 - The Router received a bad directive status while attempting to
disconnect the logical link with the node that is displayed.  The displayed 
status is the directive status.
.le;ERROR 52 - An I/O error occurred while the Router was attempting to 
disconnect the logical link with the node that is displayed.  The returned 
DECNET I/O error code is the displayed status.  
.le;ERROR 53 - The Router has disconnected successfully from the node
that is displayed.  A timer will be started so that a connect with the
node may be attempted later.  No status is displayed.
.le;ERROR 54 - (FATAL) The Routing Database was not initialized properly.
Before the Router is restarted, the Routing Database must be removed and
reinstalled from disk.  Invoke STARTR.CMD to reinstall the database and
restart the Router.  No status is displayed when this error occurs.
.le;ERROR 55 - The Router received a bad directive status while attempting
to run Program FNDSRV.  This task must be installed to translate all logical
.x FNDSRV Task>Referenced
node names to actual node names.  The displayed status
is the directive status.
.le;ERROR 56 - The Router received a bad directive status while attempting
to write a connect/disconnect status message to the message id subqueue
NET_STATUS.  The displayed status is the directive status.  The name of
the node connecting or disconnecting is also displayed. 
.le;ERROR 57 - An I/O error occurred while the Router was attempting to 
to write a connect/disconnect status message to the message id subqueue
NET_STATUS.  The returned DRIVER/ACP I/O error code is the displayed status. 
The name of the node connecting or disconnecting is also displayed.  This
message id subqueue does not have to be in the queue if connect/disconnect
messages do not have to be queued.  The resulting 'message id does not exist'
error will only be logged once and can be ignored.
.els
