Envoy Application Programming Manual

Table Of Contents
Software Concepts
Envoy Application Programming Manual427159-001
2-18
Polling Operation
The supervisor station initiates polling by calling the READ procedure while the line is
in the CONTROL state. Tributary stations, whether or not they have data to send, must
monitor the line by calling the READ procedure.
Polling Inactive Bit
If a tributary station does not have data to send, it must set the polling inactive bit in the
polling address in its address list. (See the DEFINELIST and CHANGELIST procedures
in Appendix C, File-System Procedures
.) When an inactive tributary is polled, Envoy, on
behalf of the application process, returns an EOT received indication to the supervisor.
The call to READ by an inactive tributary station does not complete until the application
process makes the station active, the operation times out (that can happen only if the line
is open with nowait I/O specified), or if the station is selected. If a tributary station has
data to send, the application resets the polling inactive bit, thus making the station
active. When polled, the tributary’s READ completes with an error 166 (ENQ received).
The tributary then responds by calling the WRITE procedure one or more times to send
data to the supervisor.
The call to READ by the supervisor that initiated polling also reads the first message
from the responding tributary station. The supervisor station must then call READ for
each additional message from the tributary station. Messages are read until the tributary
station sends an EOT.
Continuous and Noncontinuous Polling
There are two basic types of polling provided: continuous and noncontinuous. In
continuous polling, the stations in the address list are polled sequentially until a station
responds to the poll (or until the HALTPOLL procedure is called). In noncontinuous
polling, the application process specifies the number of times that the stations are to be
polled (also sequentially). If noncontinuous polling is specified and no station responds
to the poll, the READ by the supervisor station completes with an error 176 (poll
sequence ended with no responder).
When polling stops because of a transmission from a tributary station or a call to the
HALTPOLL procedure, a subsequent resumption of polling starts with the next station
in the address list.
Example 2-7
shows a supervisor station that has specified continuous polling. Station B
has no data to send and, therefore, has its polling inactive bit set. Station C does have
data to send; the data consists of two message transfers.
Note. If a tributary station is not monitoring the line when polling occurs, the polling by the
supervisor station stops with an error 176 when such a station is polled. The detection of this
error causes Envoy, on behalf of the supervisor station, to put the nonresponding station in a
nonresponding station list. Stations in the station disabled list are not polled when subsequent
polling occurs. A station may be removed from the station disabled list with a call to the
CHANGELIST procedure. If a station is removed from the nonresponding station list, it is polled
when polling resumes.