Envoy Application Programming Manual

Table Of Contents
Software Concepts
Envoy Application Programming Manual427159-001
2-8
Message Formats
Example 2-2 shows the following points:
Because the receipt of a message is not acknowledged until there is a subsequent
READ call, the receiver’s message processing time must be less than the configured
send timeout of the sender (the maximum amount of time that the sender waits for a
reply). If the BISYNC protocol is used and the receiver’s processing takes longer
than the sender’s timeout period, the receiver can periodically (that is, every two
seconds) issue a wait-for-acknowledgment (WACK) control sequence to the sender.
In BISYNC point-to-point links, the send timeouts are configured so that the
primary station has a shorter timeout value than the secondary station (usually 2.6
seconds as opposed to 3 seconds). The shorter timeout value allows the primary to
win in contention line-bid situations. In other types of links, the recommended send
timeout is 3 seconds.
A similar situation exists for the sender. Because the receiver’s READ does not
complete until a message is sent, the sender must be able to prepare and send a
message within the receive timeout period of the receiver. The receive timeout
period is usually, however, considerably longer than a send timeout. (See Line-Error
Handling on page 2-22.)
Example 2-2 generalizes the use of a BISYNC point-to-point communications. It is
not directly applicable to other protocols.
Message Formats
The information read from or written to the data buffer area of the application is made
up of two items: a message control word (MCW) followed by the message.
line^buffer[0] = MCW
line^buffer[1:n] = message
where n is the message length in words (length in bytes divided by two and rounded up
if necessary).
For point-to-point lines, the MCW is ignored but must still be included in the write and
read buffer.
For multipoint lines, the general form of the MCW is:
The message control word is not transmitted over the communications line. The MCW
is, however, reflected as two bytes in the count read or written:
count read or count written = 2 + message length in bytes
MCW.<0:7> = Varies from protocol to protocol. In a BISYNC multipoint
tributary, for example, bit 1 of the MCW is used with READ
operations to specify whether an initial READ or a continuation
READ is being performed.
MCW.<8:15> = Entry number. During polling, Envoy returns a value that
designates the station that responded to the poll. For selection,
the application process sets this value to designate the station to
be selected.