User`s guide

Table Of Contents
Chapter 4 75
Performing a Calibration
Sample Program
4. Performing a Calibration
ECal
Example 4-2 shows a sample program that demonstrates how to use ECal. You can find the
source file of this program, named ecal.htb, on the sample program disk.
The sample program performs full 1-port or 2-port calibration using ECal, and saves the
results to a file named “Ex_4_2.sta.”
The program is described in detail below:
Line 40 Assigns a GPIB address to the I/O pass.
Line 50 Stores the name of the file (Ex_4_2.sta) into the File$ variable.
Line 60 Stores the channel number (1) into the Ch$ variable.
Line 90 Allows the user to return to the entry start line and re-enter the data if
an error (such as an invalid entry) occurs while selecting the
calibration type number.
Lines 110 to 160 These lines display the list of supported calibration types, and prompt
the user to choose one of the items by typing in the appropriate
number.
Line 170 Converts the entered value into an integer and stores it into the
Cal_type variable.
Line 180 Returns to the entry start line if an invalid value is contained in
Cal_type.
Lines 210 to 220 These lines call a subprogram named Select_port to select the
appropriate port based on the value of Cal_type, and then perform
ECal.
Lines 240 to 250 These lines configure the system to save calibration coefficients along
with instrument settings, and then save the instrument settings under
the file name contained in the File$ variable.
For more information on the Select_port subprogram (lines 300 to lines 530), refer to the
description in Example 4-1.