10 '--------------------------------------------------------------- 20 ' Title: NIC4094.BAS 30 ' 40 ' Example program for the Nicolet 4094 oscilliscope 45 ' and the PC-488 interface card. 50 ' 60 ' (by Capital Equipment Corp.) 70 '--------------------------------------------------------------- 75 ' Set up PC-488 and initialize the system 76 '--------------------------------------------------------------- 82 DEF SEG=0 ' find IEEE interface code memory location 83 IEEE=PEEK(&H182)+256*PEEK(&H183) 84 IF IEEE=0 THEN PRINT "BASIC488 not installed" : STOP 85 DEF SEG=IEEE 90 INITIALIZE=0 : TRANSMIT=3 : RECEIVE=6 ' PC-488 subroutines 100 MY.ADDRESS%=21 : SYS.CONTROL%=0 ' Initialize the interface 110 CALL INITIALIZE (MY.ADDRESS%,SYS.CONTROL%) 115 ' 116 ' The following string variables are used to build TRANSMIT commands 117 ' later in the program. SEND$ sets up the computer to talk and the 118 ' scope to listen, and SEND2$ finishes a command with a return and 119 ' a line feed, then lets the scope talk and the computer listen 120 SEND$="MTA LISTEN 14 DATA '" ' strings used later 122 SEND2$="' 13 10 MLA TALK 14" ' in program 125 ' 130 FOR I=1 TO 100 : NEXT ' delay to let scope init. 135 '--------------------------------------------------------------- 136 ' Set operating modes on the scope 137 '--------------------------------------------------------------- 140 S$=SEND$+"Z1"+SEND2$ ' command to enable remote 142 ' control of the scope 150 CALL TRANSMIT (S$,STATUS%) 155 IF STATUS<>0 THEN PRINT "Error sending to scope" : STOP 160 ERR$=SPACE$(40) ' receive error code 170 CALL RECEIVE (ERR$,LENGTH%,STATUS%) 205 '--------------------------------------------------------------- 206 ' Capture some data on the scope 207 '--------------------------------------------------------------- 210 S$=SEND$+"H,0,0"+SEND2$ ' command for LIVE/HOLD NEXT 212 ' to capture a trace 220 CALL TRANSMIT (S$,STATUS%) 230 CALL RECEIVE (ERR$,LENGTH%,STATUS%) ' (get error code) 235 '--------------------------------------------------------------- 236 ' Read back data from the scope 237 '--------------------------------------------------------------- 290 ' 300 S$=SEND$+"C,4,2,13,10"+SEND2$ ' set record separator 310 CALL TRANSMIT (S$,STATUS%) 320 CALL RECEIVE (ERR$,LENGTH%,STATUS%) ' (get error code) 330 ' 340 S$=SEND$+"D,0,1,0,20,1"+SEND2$ ' ask for 20 data points 350 CALL TRANSMIT (S$,STATUS%) 360 CALL RECEIVE (ERR$,LENGTH%,STATUS%) ' (get error code) 365 R$=SPACE$(10) 370 FOR I=1 TO 20 380 CALL RECEIVE (R$,LENGTH%,STATUS%) ' get a data point 390 PRINT LEFT$(R$,LENGTH%) ' print the value 400 NEXT 410 END