Manual
17-2 Appendix G
270 PRINT "Point #";I;" X=";X(I);" Y=";Y(I)
280 NEXT I
290 !-------------------------------------------
300 ! Now play the 5 taught points back:
310 !-------------------------------------------
320 PRINT "Press RETURN to play the points back."
330 BEEP
340 INPUT Dummy ! wait for him to press RETURN
350 OUTPUT Rs232;"SR4000;"; ! step rate 4000
360 FOR I=1 TO 5
370 OUTPUT Rs232;"MA";X(I);Y(I);";"; ! vector
380 OUTPUT Rs232;"WA 0.5;"; ! wait 1/2 sec.
390 NEXT I
400 PRINT "All moves now in Automove buffer."
410 !-------------------------------------------
420 ! Now wait until the move sequence finishes
430 ! executing, just to see if an Emergency
440 ! Stop or motor slip has occurred:
450 !-------------------------------------------
460 OUTPUT Rs232;"OA;"; ! dummy request
470 ENTER Rs232;Ans$ ! await the answer
480 IF Ans$[1,1]="?" THEN 540
490 PRINT "Done -- no errors."
500 STOP
510 !-------------------------------------------
520 ! Routine to handle Exceptional Conditions:
530 !-------------------------------------------
540 BEEP
550 BEEP
560 BEEP
570 OUTPUT Rs232;Esc$;".E"; ! request Comm error
580 ENTER Rs232;Ans$ ! read error code
590 ! if error code has another "?", ignore it:
600 IF Ans$[1,1]="?" THEN Ans$=Ans$[2]
610 Err=VAL(Ans$)
620 IF Err=0 THEN 650
630 PRINT "Communications error ";Err
640 STOP
650 OUTPUT Rs232;"OS;"; ! request status byte
(Example program, cont'd.)
660 ENTER Rs232;Ans$ ! read the status