omron — Serial Line I/O

Serial Line I/O 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 eV+Language User's Guide, v2.x, 18318-000 Rev A Page 155