10 ' Title : pcto-nec 20 ' 30 ' Purpose : to transfer data files from another computer 40 ' to the PC via the IEEE-488 bus. 70 ' 80 ' Instructions: Run this program then send data from the 90 ' source computer to device address one. 100 ' The PC appears as a printer at address one. 110 ' To save the transferred file on disk, provide a 120 ' filename when prompted. 130 ' 170 DEFINT A-Z 180 LINE.COUNT = 0 240 DEF SEG = 0 242 IEEE=PEEK(&H182)+256*PEEK(&H183) 245 IF IEEE=0 THEN PRINT "BASIC488.EXE not loaded" : STOP 247 DEF SEG=IEEE 250 INIT = 0 :XMIT = 3 :RECV = 6 'firmware offset addresses 260 R$=SPACE$(80) 'receive string length 270 PC.ADDRESS = 1 :DEVICE = 2 'pc gp-ib address 1, device 280 INPUT "Enter file name to save or to end > ",FILENAME$ 290 IF FILENAME$= "" THEN STOP 300 OPEN FILENAME$ FOR OUTPUT AS #1 310 CALL INIT(PC.ADDRESS, DEVICE) 320 IF INP(&H2BC) AND 4 THEN 330 ELSE 320 'if addressed then receive 330 CALL RECV (R$,L,S) 340 R$ = LEFT$ (R$,L) 'trim the string to length 350 PRINT R$ 'print transferred line 360 PRINT #1,R$ ' save line to file 370 LINE.COUNT=LINE.COUNT+1 380 R$=SPACE$(80) 390 IF S<>8 THEN 330 'continue until timeout 400 ' 410 CLOSE 420 PRINT LINE.COUNT;" lines transferred." 430 END