Sample Program For Save/Recall - Agilent Technologies 4294A Programming Manual

Precision impedance analyzer
Hide thumbs Also See for 4294A:
Table of Contents

Advertisement

Saving/Recalling a Measurement Result/Measurement Setup

Sample Program for Save/Recall

Example 8-1 shows a sample program to save a file. This program is stored on the sample
program disk as the file_sav.bas file.
This program sets the save destination mass storage to the flash disk and saves data the user
specified using a user specified filename.
Lines 40 to 80
Identifies the external controller and Instrument BASIC and sets the
GPIB address.
Line 100
Sets the mass storage to the flash disk.
Line 110
Uses the Inp_file_name subprogram to obtain a user-entered save
filename and stores it in the File$ variable.
Line 130
Allows the user to return to the entry start line and enter the data again,
if an error occurs when selecting the contents of a file due to, for
example, a typing error.
Lines 150 to 200
Displays the list of save items (and file formats) and prompts the user
to enter the desired number (1 to 4).
Line 210
Converts the entered value to an integer and substitutes it into the
Content variable.
Line 220
If the value of Content is not an integer between 1 and 4, returns to the
entry start line.
Lines 250 to 500
Depending on the value of Content, substitutes the extension and the
save command name into the Extension$ variable and the Command$
variable, respectively. If the value of Content is 2 or 3, uses the
Select_array subprogram to select the saved internal data array.
Line 530
Clears the error queue.
Line 540
Creates a program message to execute the save from the Command$
and File$ variables and sends it to the 4294A.
Lines 550 to 560
Checks for the occurrence of an error.
Lines 580 to 600
If an error of the -257 error number has occurred (error when a
filename has a problem, for example, when a file having the same
name exists), prompts the user to select from "Change File Name",
"Purge File", or "End."
Lines 610 to 630
If "Change File Name" is selected, uses the Inp_file_name
subprogram again to obtain the user-entered save filename, and returns
to the save start line.
Lines 650 to 670
If "Purge File" is selected, deletes the existing file having the same
filename, and returns to the save start line.
Line 690
Displays the "Save Not Complete" message.
Lines 710 to 720
If an error of the -257 error number has not occurred, displays the
"Save Complete" message and the save filename.
The Inp_file_name subprogram in lines 790 to 910, used to enter a save filename, is
described below.
Chapter 8
Sample Program for Save/Recall
115

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents