Envoy Application Programming Manual

Table Of Contents
Asynchronous Line Supervisor Protocol
Envoy Application Programming Manual427159-001
10-24
Read-Only Programming Examples
Example 10-6. Read-Only Programming Example (Page 2 of 2)
t^count := 75; ! set timeout value 750 ms.
CALL SETMODE (rlineno,set^tmout,t^count);
t^count := full^plex + r^continuous; ! set line type read
! only.
CALL SETMODE(RLINENO,SET^LTYPE,T^COUNT);
next^rec:
CALL READ (rlineno,buffer,80,t^count);
! read from line.
IF < THEN GOTO next^rec;
rpbuff[t^count + 1] := CR;
! set printer CR/LF.
rpbuff[t^count + 2] := LF;
repeat^w:
CALL WRITE (plineno,buffer + 1,t^count);
! pass over MCW.
IF < THEN GOTO repeat^w;
IF NOT buffer[1] = cancan THEN GOTO next^rec;
! terminate on receive cancan.
CALL CLOSE (rlineno);
stop^rfail:
CALL CLOSE (plineno);
stop^pfail:
END;