Envoy Application Programming Manual

Table Of Contents
BISYNC Multipoint Tributary Protocol
Envoy Application Programming Manual427159-001
5-43
Programming Examples
Example 5-15. Program Code for BISYNC Multipoint Tributary (Page 4 of 7)
sbuf ’:=’ "FROM " -> @s;
s := IF $ALPHA (source.<8:15>) THEN source.<8:15>
ELSE source.<8:15> LOR %60; ! convert binary to
! ASCII.
s[1] := ":";
s[2] ’:=’ [" "] & array FOR length -> @s;
! display the message.
done := 0;
WHILE NOT done DO
BEGIN
CALL WRITE (termfnum, buf, @s ’-’ @sbuf);
CALL AWAITIO (termfnum);
IF = THEN done := 1
ELSE
IF NOT FILEERROR (termfnum)
THEN CALL ABEND; ! fatal.
END
END; ! write^term.
! This procedure is used to format and send a message to the
! supervisor when the station is polled.
!
! The "array" passed to "send" is of the form:
!
! <d>,<text>
!
! <d> = destination {S,0:3}, <text> is message to be sent.
!
! When the message is successfully transmitted, the
! CHANGELIST
! procedure is called to set the station’s poll state to
! "inactive."
PROC send (array, length);
STRING .array;
INT length;
BEGIN
STRING .s;