Download GPIB Programming Guide - Steven M. Anlage Research Page

Transcript
Disk I/O for a Storage Unit
The analyzer has a built-in disk drive and RAM disk memory. You can save or get data using
these disks with Instrument BASIC.
Saving Trace Data
d
c
This program saves the analyzer's current raw measurement data to an arbitrarily named le.
10
20
30
40
50
DIM File_name$[10]
ASSIGN @Hp4396 TO 800
INPUT "ENTER FILE NAME (up to 10 Characters)",File_name$
OUTPUT @Hp4396;"SAVDDAT """;File_name$;""""
END
Loading Trace Data
d
c
a
b
Figure 6-4. Saving Trace data
This program loads trace data from the built-in disk drive into the \Dat" array.
10 DIM Dat(1:201,1:2)
20 DIM File_name$[10]
30 ASSIGN @Hp4396 TO 800
40 MSI ":INTERNAL,4"
50 INPUT "ENTER FILE NAME (without EXT.)",File_name$
60 File_name$=File_name$&".DAT"
70 ASSIGN @File TO File_name$ ! Open target file
80 ENTER @File USING "16X,#"
90 ENTER @File USING "12X,#"
100 ENTER @File;Dat(*)
! Load data from file
110 ASSIGN @File TO *
! Close file
120 PRINT Dat(*)
130 END
a
b
Figure 6-5. Loading Trace Data
Line 40 selects the internal exible disk drive. When you want to use the RAM disk memory,
change ":INTERNAL,4" to ":MEMORY,0".
Line 60 adds an extension ".DAT" to le name for the DOS format le. When you want to use
LIF format le, change ".DAT" to "_D".
Application Programs 6-3