'---------------------------------- ' Example 2: testing for a service request (SRQ) '---------------------------------- '$INCLUDE: 'ieeeqb.bi' ' CALL initialize (21,0) ' CALL send (4,"MEASURE",status%) IF STATUS%<>0 THEN STOP '--- now, wait for SRQ status bit --- ' (see "The computer as a device" in the manual for a list ' of all the status bits) ' NOTE: With BASIC Interrupt Software from CEC, other processing ' can occur while waiting for SRQ. ' Waitsrq: IF (INP(&H2BA) AND &H40)=0 THEN GOTO Waitsrq ' ' -- SRQ has occurred, now read the result R$=SPACE$(80) ' get up to 80 characters from device CALL enter(R$,LENGTH%,4,STATUS%) IF STATUS%<>0 THEN STOP ' test for errors in ENTER PRINT "Data received='";LEFT$(R$,LENGTH%);"'" END