10 '---------------------------------- 20 ' Example 2: testing for a service request (SRQ) 30 '---------------------------------- 42 DEF SEG=0 ' find IEEE interface code memory location 43 IEEE=PEEK(&H182)+256*PEEK(&H183) 44 IF IEEE=0 THEN PRINT "BASIC488 not installed" : STOP 45 DEF SEG=IEEE 50 INITIALIZE=0 : SEND=9 : ENTER=21 :srqtest=63 ' offsets for PC<>488 routines 60 MY.ADDRESS%=21 : LEVEL%=0 ' make PC a controller at address 21 70 CALL INITIALIZE(MY.ADDRESS%,LEVEL%) 80 ADDRESS%=4 ' instrument address is 4 90 S$="MEASURE" ' tell device to take a measurement 100 CALL SEND(ADDRESS%,S$,STATUS%) 110 IF STATUS%<>0 THEN STOP 115 '--- now, wait for SRQ status bit --- 121 ' NOTE: With BASIC Interrupt Software from CEC, other processing 122 ' can occur while waiting for SRQ. 124 ' 125 CALL SRQTEST(s%) 126 IF s%=0 THEN 125 130 ' 131 ' -- SRQ has occurred, now read the result 140 R$=SPACE$(80) ' get up to 80 characters from device 150 CALL ENTER(R$,LENGTH%,ADDRESS%,STATUS%) 160 IF STATUS%<>0 THEN STOP ' test for errors in ENTER 170 PRINT "Data received='";LEFT$(R$,LENGTH%);"'" 180 END