U9361C/F/G/M RCal Receiver Calibrator Measurement Guide
57
Programming with MATLAB
Programming with MATLAB
SCPI commands can be used to help simplify and speed up the RCal configuration and calibration
process. The software for RCal calibrations is stored and executed on the analyzer itself, so
commands must be made through a USB, VISA, or GPIB connection to the signal analyzer directly.
Additionally, some of the following programming examples require a connection to the signal
generator in the test setup.
Magnitude Calibration and Comparison with Use Current Meas
This script allows you to perform a magnitude calibration that utilizes the
Use Current Meas
command for an efficient demonstration of RCal’s RX power correction capabilities.
clear all;
close all;
instrreset;
clc;
% Define Parameters Here:
SA_address = 'USB0::0x2A8D::0x0D0B::MY49431812::0::INSTR'
SG_address = 'USB0::0x0957::0x1F01::MY53050777::0::INSTR'
center_freq = 5;
freq_span = 2;
amp = -50;
cal_group = 1;
cal_row = 1;
% Create VISA objects for your X-Series Signal Analyzer and Power Source
my_SA = visa('keysight', SA_address);
my_SG = visa('keysight', SG_address);
% Connect to the instruments
fopen(my_SA);
fopen(my_SG);
% get instrument identification to make sure we are speaking with the
% devices
query(my_SA,'*idn?')
query(my_SG,'*idn?')
% Set up SG to sweep from 5 to 6 GHz, 101 points, -20dBm
fprintf(my_SG, ':FREQuency:MODE LIST');
fprintf(my_SG, ':SWE:GEN STEP');
fprintf(my_SG, ':FREQ:CENT %dGHz', center_freq);
fprintf(my_SG, ':FREQ:SPAN %dGHz', freq_span);
fprintf(my_SG, ':POW %ddBm', amp);
% Set X-Series Signal Analyzer to basic mode, set trace to <> hold order to see avg.
power
% level before calibration
fprintf(my_SA, ':INST:SEL SA');
fprintf(my_SA, ':SYST:PRES:TYPE MODE');