Specifications

42 Chapter 4
Preparing for Accurate Measurement
Performing Calibration
Sample program
Example 4-1 shows a sample program that demonstrates how to obtain the measurement
data for calculating the calibration coefficients. You can find the source file of this
program, named calib.bas, on the sample program disk.
The sample program begins by configuring the measurement point setup table and
calibration kit. After measuring the necessary data, it then calculates the calibration
coefficients and turns on the calibration function. Finally, it saves the obtained calibration
coefficients to a file named CAL_DATA.
The program is described in detail below.
Lines 100 to 110 Sets the GPIB address and select code.
Line 120 Stores the name of the calibration coefficients file (CAL_DATA) into
the File$ variable.
Line 130 Resets the instrument.
Line 140 Sets the data transfer format to ASCII.
Lines 180 to 230 Configures the measurement point setup table as follows:
Line 260 Passes control to a subprogram named Set_cal_kit to configure the
calibration kit.
Lines 290 to 320 Passes control to a subprogram named Inp_data, which prompts the
user to enter the limit values for each standard. Then the program
stores the R
dc
measurement lower limit for the OPEN standard into the
Open_l_lim variable, the R
dc
measurement upper limit for the SHORT
standard into the Short_u_lim variable, and the R
dc
measurement
lower and upper limits for the LOAD standard into the Load_l_lim and
Load_u_lim variables, respectively.
Lines 350 to 420 Passes control to a subprogram named FNCal, which measures the
data for OPEN, SHORT, and LOAD standard.
Lines 440 to 450 Prompts the user to confirm whether to measure a low-loss capacitor
and waits until the user presses the y or n key.
Lines 460 to 490 If the user presses the y key in response to line 450, the program
passes control to the FNCal subprogram to obtain the measurement
data for the low-loss capacitor.
Lines 420 to 440 Calculates the calibration coefficients and turns on the calibration
function.
Lines 570 to 610 Retrieves the number of measurement points and resizes the arrays
Cal_coef_a1, Cal_coef_a2, Cal_coef_b1, Cal_coef_b2, Cal_coef_c1,
and Cal_coef_c2 accordingly.
Point
number
Measuring
frequency
Averaging factor
Signal source
level
1 10 MHz 4 0 dBm
2 100 MHz 4 0 dBm
3 1 GHz 4 0 dBm