Envoy Application Programming Manual

Table Of Contents
ADM-2 Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
7-48
WRITEREAD (Send Function and Read Message)
Example 7-26 shows the program coding for the Send Function and Read Message
operation shown in Example 7-25.
Example 7-26. Program Code for Send Function and Read Message
! poll the network.
CALL READ (linefnum,linebuf[-1], 5, line^count^read);
IF = AND slinebuf = SOH THEN ! terminal responded to poll.
BEGIN
! format the send function.
slinebuf ’:=’ [ EOT ] & "w" - @s; ! send page foreground
! function.
s := mcw.<8:15> + poll^count; ! entry number of
! terminal.
s[1] := 0; ! place holder.
s[2] := [ ENQ ];
! clear message control word.
mcw := 0;
! set message type = special.
mcw.<6> := 1;
! transmit the send function, read the screen.
CALL WRITEREAD (linefnum, linebuf, 7, line^read^count,
line^count^read);
IF THEN ... ! bad news.
! save the message for processing (without MCW, STX,
!ETX).
s^message ’:=’ s^linebuf[1] FOR
(msg^len := line^count^read - 4);
! process the message.
! send the reply to the terminal.
CALL send (message, msg^len, mcw.<8:15> + poll^count);
! see "Select" example.
END
ELSE
BEGIN
! bad news.
END;