DCA-X IPTB Calibration
On an N1000A DCA-X, this Python script runs the internal precision timebase (IPTB) calibration. This calibration includes three parts:
- A calibration without any input signals.
- A skew calibration at 1 GHz.
- A skew calibration at 20 GHz.
The 1 GHz and 20 GHz calibration signals must be sinusoidal between 50 mVp-p to 700 mVp-p. Connect the calibration signal through a splitter to the mainframe's Trigger and Precision Timebase inputs. No plug-in modules need to be installed in the DCA-X mainframe.
The following script manages the dialogs that are displayed during the calibration and instructs you to connect or change the cal signal as needed. The source's settings are manually controlled from the source's GUI. If you want to automate the control of the source, modify the script by inserting SCPI source commands in place of the user prompts.
DCA-X_IPTB_calibration.py
"""
This script performs an N1000A mainframe precision timebase calibration.
Disconnect all channel inputs before running the script. Plug-in
modules do not need to be installed. Cal automatically places N1000A in
Scope mode. Script alerts user to connect a 50 mVp-p to 700 mVp-p 1 GHz
sinusoid to N1000A's trigger and precision timebase front panel inputs.
An additional pass is done at 20 GHz.
"""
PASSED = True
import pyvisa as visa
rm = visa.ResourceManager(r'C:\WINDOWS\system32\visa64.dll')
flex = rm.open_resource('TCPIP0::K-N1000A-00231::hislip0,4880::INSTR')
flex.timeout = 480000 # 8 minutes
flex.write('SYSTem:DEFault;*OPC?')
print('N1000A IPTB Calibration')
print("Disconnect any signals to N1000A trigger or PTB inputs.")
input("Press any key to continue...")
flex.write(':CALibrate:FRAMe:PTIMebase:STARt;*OPC?')
# intro dialog displayed
flex.write(':CALibrate:CONTinue') # start first cal step
print("Waiting for first cal step to complete.\n")
s = flex.query(':CAL:SDONE?') # returns next cal prompt or error string
print(s)
if not s.startswith('"Please connect a 1.0 GHz'):
PASSED = False
flex.write(':CALibrate:CONTinue;*OPC?')
# 1 GHz skew cal dialog displayed
if PASSED: # start 1 GHz skew cal
input("\nPress any key to continue...")
flex.write(':CALibrate:CONTinue') # dismiss dialog to start 1 GHz skew cal step
print("Waiting for 1 GHz skew cal to complete.\n")
s = flex.query(':CAL:SDONE?') # returns next cal prompt or error string
print(s)
if not s.startswith('"Please connect a 20 GHz'):
PASSED = False
flex.write(':CALibrate:CONTinue;*OPC?')
# 20 GHz skew cal dialog displayed
if PASSED: # start 20 GHz skew cal
input("\nPress any key to continue...")
flex.write(':CALibrate:CONTinue') # dismiss dialog to start 20 GHz skew cal step
print("Waiting for 20 GHz skew cal to complete.\n")
s = flex.query(':CAL:SDONE?') # returns next cal prompt or error string
print(s, '\n')
if not s.startswith('"Internal Precision Timebase Calibration has completed successfully'):
PASSED = False
flex.write(':CALibrate:CONTinue;*OPC?')
flex.write(':CALibrate:CONTinue') # dismiss final dialog
if not PASSED:
print('The IPTB calibration failed.')
flex.write(':CALibrate:CONTinue;*OPC?')
flex.write(':SYSTem:GTLocal')
flex.close()