User`s guide

$buffer = "" ;Initialize buffer to empty
done = FALSE ;Assert not done
DO
CLEAR.EVENT
c = GETC(line,1) ;Read byte from the ser. line
WHILE c == ienod DO ;While there is no data...
WAIT.EVENT 1 ;Wait for an event
CLEAR.EVENT
c = GETC(line,1) ;Read byte from the ser. line
END
IF c < 0 GOTO 90 ;Check for errors
IF c == etx THEN ;If ETX seen...
TYPE $buffer, /N ;Type buffer
done = (LEN($buffer) == 0) ;Done if buffer length is 0
$buffer = "" ;Set buffer to empty
ELSE
$buffer = $buffer+$CHR(c) ;Append next byte
;to buffer
END
UNTIL done ;Loop until empty buffer seen
GOTO 100 ;Exit
90 TYPE "SERIAL LINE I/O ERROR: ", $ERROR(IOSTAT(line))
PAUSE
100 DETACH (line)
RETURN
.END
1
The controller configuration utility is available in the file CONFIG_C.V2.
Serial Line I/O
V+Language User's Guide, v17.0
Page 226