Envoy Application Programming Manual

Table Of Contents
Asynchronous Line Supervisor Protocol
Envoy Application Programming Manual427159-001
10-25
Asynchronous Supervisor Programming Example
Asynchronous Supervisor Programming Example
The programming examples in Example 10-8 through Example 10-11 show the
following operations for an asynchronous supervisor:
Poll a Terminal and Read a Message on page 10-26
Select a Terminal and Send a Message on page 10-26
Send a Break Signal on page 10-27
Enable and Disable a Switched Line on page 10-27
The declarations shown in Example 10-7
are used in the programming examples.
Example 10-7. Declarations Used in Asynchronous Supervisor Examples
INT linedef[0:12], ! Name of comm line.
lineno, ! File number of comm line.
r^count, ! received read count.
t^count, ! transmit character count.
buffer[-1:99]; ! application line buffer.
STRING .sline := @linedef ’<<’ 1,
.sbuff := @buffer ’<<’ 1;
DEFINE mcw = buffer[-1]#;
LITERAL
num^entries = 6, ! number of terminals.
addr^size = 2, ! address size in words.
no^data^cnt = 4, ! no data response length.
no^data^ctl = %10004, ! no data response.
data^return = 1, ! nonzero for return data.
no^data^return = 0, ! zero for no data return.
set^tmout = 15, ! SETMODE timeout.
snd^brk = 15, ! CONTROL send break.
set^cd = 17, ! CONTROL enable CD.
EOT = %4,
ENQ = %5;
INT addr^list[0:num^entries * addr^size - 1] :=
[ EOT, "AA", ENQ, ! terminal 1.
EOT, "AB", ENQ, ! terminal 2.
EOT, "AC", ENQ, ! terminal 3.
EOT, "AD", ENQ, ! terminal 4.
EOT, "AE", ENQ, ! terminal 5.
EOT, "AF", ENQ ]; ! terminal 6.