Specifications
56 Chapter 4
Preparing for Accurate Measurement
Running the Compensation Process
Sample program
Example 4-2 shows a sample program that demonstrates how to obtain the measurement
data for calculating the compensation coefficients. You can find the source file of this
program, named compen.bas, on the sample program disk.
The sample program begins by configuring the measurement point setup table, retrieving
the calibration coefficients determined in Example 4-1 from the file, and configuring the
instrument accordingly. It lets the user select a test fixture and configure the compensation
kit. Finally, it measures the data for calculating the compensation coefficients.
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.
Lines 130 to 140 Stores the R
dc
measurement lower limit for the OPEN standard
(100 W) into the Open_l_lim variable and the R
dc
measurement upper
limit for the SHORT standard (25W) into the Short_u_lim variable.
Line 150 Resets the instrument.
Line 160 Sets the data transfer format to ASCII.
Lines 200 to 250 Configures the measurement point setup table as shown below (with
the same settings as Example 4-1).
Lines 290 to 500 Turns on the calibration function by issuing two commands in
sequence to obtain the calibration data and then calculate the
calibration coefficients. The calibration coefficients acquired here will
be used to overwrite those retrieved from the file (lines 680 to 770) but
will not be used for measurement.
Lines540to580 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.
Line 620 Points to the statement block to be executed if an error occurs in
retrieving the calibration coefficients from the file (for example, if no
file matches File$).
Lines 630 to 650 Retrieves the calibration coefficients for impedance measurement, A1,
B1, C1, A2, B2, and C2, as well as those for R
dc
measurement, and
then stores them into the arrays Cal_coef_a1, Cal_coef_b1,
Cal_coef_c1, Cal_coef_a2, Cal_coef_b2, Cal_coef_c2, and
Cal_coef_dc, respectively.
Lines 680 to 770 Sets the calibration coefficients.
Line 820 Passes control to a subprogram named Set_fixture, which configures
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