FAQs from Rohde & Schwarz

通过 GPIB 将硬拷贝文件从 FSP 传输到 PC

问题

能否使用 GPIB 命令,将硬拷贝文件从 FSP 硬盘传输到 PC 的软盘?

回答

是的,可以这样做。下面描述了如何将硬拷贝文件从 FSP 硬盘复制到 GPIB 控制器的 BASIC 示例。

10 REM Set the termination EOI

20 IEC TERM 1

30 IEC OUT 20,"SYST:COMM:GPIB:RTER EOI"

40 REM Change the hardcopy language to WMF

50 IEC OUT 20,"HCOP:DEV:LANG WMF"

60 REM Change the hardcopy port to file

70 IEC OUT 20,"HCOP:DEST1 'MMEM'"

80 REM Set the file name

90 IEC OUT 20,"MMEM:NAME 'C:\USER\DATA\FILE.WMF'"

100 REM Make the hardcopy

110 IEC OUT 20,"HCOP;*WAI"

130 REM Set the path to hard disk c:

140 IEC OUT 20,"MMEM:MSIS 'C'"

150 REM Set the path

160 IEC OUT 20,"MMEM:CDIR '\USER\DATA\'"

170 REM Place the file in the output buffer

180 IEC OUT 20,"MMEM:DATA? 'FILE.WMF'"

190 REM The file is transferred with header. The first character is '#'

200 REM The next character indicates how many characters will follow

210 REM plus how large the file is without header

220 REM The header, for example #43210, will be removed by the

230 REM next steps.

240 REM Get the file out of the buffer

250 IEC IN 20,S$

270 X=VAL(MID$(S$,2,1))

280 Z=VAL(MID$(S$,3,X))

290 T$=MID$(S$,X+3,Z)

300 REM Open a file as output

310 OPENO# 1,"A:\HARDCOPY.WMF"

320 REM Save the WMF data to this file

330 PRINT# 1,T$

340 END