User`s guide

Table Of Contents
140 Chapter 9
Saving and Recalling (File Management)
Managing Files
Sample program
Example 9-1 shows a sample program for transferring files between the external controller
and the E5061A/E5062A. You can find the source file of this program, named file_xfr.bas,
on the sample program disk.
This program reads out data from a specified file on the external controller (or the
E5061A/E5062A), then write them to a specified file on the E5061A/E5062A(or the
external controller).
The program is described in detail below:
Line 40 Assigns a GPIB address to the I/O pass.
Lines 60 to 130 These line allow the user to return to the entry start line and re-enter
the data if an error (such as an invalid entry) occurs while entering the
number that indicates the transfer direction. Then, these line display
the list of transfer directions and prompt the user to input a selected
number.
Lines 80 to 130 These lines display the list of transfer directions, and prompt the user
to choose one of the items by typing in the appropriate number.
Lines 140 to 150 Converts the entered value into an integer and stores it into the
Direction variable. Returns to the entry start line if an invalid value is
contained in Direction.
Lines 180 to 210 These lines obtain the name of the source file for copying from the
user input, store it into the Src_file$ variable, and display the value of
Src_file$.
Lines 180 to 210 These lines obtain the name of the source file for copying from the
user input, store it into the Src_file$ variable, and display the value of
Src_file$.
Lines 230 to 270 If Direction is equal to 2 (from the external controller to the
E5061A/E5062A), these lines obtain the size of the source file for
copying, store it into the Src_size_char$, and display the value of
Src_size_char$.
Lines 290 to 320 These lines obtain the name of the destination file for copying from the
user input, store it into the Dst_file$ variable, and display the value of
Dst_file$.
Line 350 If Direction is equal to 1 (from the E5061A/E5062A to the external
controller), these lines use the subprogram Copy_to_contr to transfer
(copy) a file with the name Src_file$ on the E5061A/E5062A to a file
with the name Dst_file$ on the external controller.
Line 370 If Direction is equal to 2, these lines use the subprogram
Copy_to_e507x to transfer (copy) a file with the name Src_file$ on the
external controller to a file with the name Dst_file$ on the
E5061A/E5062A.
Copy_to_contr, a subprogram for transferring files from the E5061A/E5062A to the
external controller that appears in lines 440 to 1000, is described below.
Lines 490 to 520 If any file with the name File$ already exists, these lines delete the file
and newly create a file with the name File$.
Line 530 Assigns a destination file for copying to the I/O pass.