Envoy Application Programming Manual

Table Of Contents
BISYNC Centralized Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
4-49
Programming Examples
Example 4-20 shows the program code in each process:
Example 4-20. Program Code for Poll and Select Procedures (Page 1 of 7)
! line buffer message format (transparent text)
!
! byte
! [0] [2] [3] [4] [5] [7]
! MCW DLE STX <s> <d>,-<text>-ETX
!
! MCW = message control word
!
! s = source station identity, one byte: S = supervisor,
! 0:3 = tributary
! d = destination station identity.
!
INT termfnum, ! terminal file number.
.termbuf[0:66], ! terminal buffer.
termlen, ! terminal count read.
term^done, ! terminal completion flag.
linefnum, ! line file number.
.linebuf[0:69], ! line buffer.
linelen; ! line length.
LITERAL
linecnt = 140; ! line read count.
STRING
.stermbuf := @termbuf '<<' 1,
.slinebuf := @linebuf '<<' 1;
! useful ASCII characters.
LITERAL
STX = %02,
ETX = %03,
ENQ = %05,
DLE = %20,
SYN = %26;
! define address list.
LITERAL
addr^size = 2, ! address size in words.
num^entries = 8, ! number of address list entries.
poll^count = 4; ! number of poll list entries.