User`s guide

Table Of Contents
Chapter 4 67
Performing a Calibration
Sample Program
4. Performing a Calibration
Sample Program
Calibration
Example 4-1 shows a sample program that demonstrates how to calibrate the instrument.
You can find the source file of this program, named cal.htb, on the sample program disk.
The sample program performs calibration with the specified calibration type, and saves the
results to a file named “Ex_4_1.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_1.sta) into the File$ variable.
Line 60 Stores the channel number (1) into the Ch$ variable.
Line 80 Calls a subprogram named Select_cal_kit to select the calibration kit.
Line 110 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 130 to 210 These lines display the list of supported calibration types, and prompts
the user to choose one of the items by typing in the appropriate
number.
Line 220 Converts the entered value into an integer and stores it into the
Cal_type variable.
Line 230 Returns to the entry start line if an invalid value is contained in
Cal_type.
Lines 260 to 420 These lines call a subprogram named Select_port to select the
appropriate port based on the value of Cal_type, and then perform
calibration.
Lines 280 to 290: If Cal_type = 1, the program calls a subprogram
named Cal_resp to perform response calibration (OPEN) after
selecting the port.
Lines 310 to 320: If Cal_type = 2, the program calls the
subprogram Cal_resp to perform response calibration (SHORT)
after selecting the port.
Lines 340 to 350: If Cal_type = 3, the program calls a subprogram
named Cal_resp_thru to perform response calibration (THRU)
after selecting the port.
Lines 370 to 380: If Cal_type = 4, the program calls a subprogram
named Cal_solt to perform full 1-port calibration after selecting
the port.
Lines 400 to 410: If Cal_type = 5, the program calls the
subprogram Cal_solt to perform full 2-port calibration after
selecting the port.
Lines 440 to 450 These lines configure the system to save calibration coefficients along