86100D DCA-X Timebase User Calibration

This script performs a 86100D timebase user calibration. Before running the script, a 10 GHz sinusoid must already be connected to the front panel trigger input and to the channel 2 input. The signal should be displayed on the 86100D. When the calibration starts, the 86100D automatically switches to oscilloscope mode. To use a different channel, modify the script. The script performs the following tasks:

  1. Selects the channel 2 as the calibration waveform.
  2. Starts the calibration which displays the introduction dialog.
  3. Queries and prints the text message that is displayed in the dialog. Program waits for dialog to be displayed and the string is returned. The returned string is in double quotes followed by a newline character.
  4. Continues the calibration procedure.
  5. Queries and prints the text message in the calibration complete dialog.
  6. Continues the calibration procedure which ends the procedure and closes the dialog.
  7. Checks the status of the calibration to see it is was successful.

Example Script

Copy

86100D-timebase-user-cal.py

# -*- coding: utf-8 -*-
"""
This script performs a mainframe user timebase calibration on an
86100D. Before running the script, a 10 GHz sinusoid must already be
connected to the front panel trigger input and to the channel 2 input.
To use a different channel, modify the script.
"""

import pyvisa as visa

rm = visa.ResourceManager(r'C:\WINDOWS\system32\visa64.dll')
flex = rm.open_resource('TCPIP0::K-86100D-60291::hislip0,4880::INSTR')
# flex = rm.open_resource('TCPIP0::localhost::hislip0,4880::INSTR')
flex.timeout = 120000
flex.write(':SYSTem:AUToscale;*OPC?')
flex.write(':CALibrate:FRAMe:TIMebase:USER:CHANnel CHAN2A')
flex.write(':CALibrate:FRAMe:TIMebase:USER:STARt')
# print Cal Channel select dialog message
print(flex.query(':CALibrate:SDONe?'))
flex.write(':CALibrate:CONTinue')  # 'click' continue

#  Calibration is running. Long timeout needed

# print Cal completed dialog message
print(flex.query(':CALibrate:SDONe?'))
flex.query(':CALibrate:CONTinue;*OPC?')  # 'click' continue
if 'UNCALIBRATED' in flex.query(':CALibrate:FRAMe:TIMebase:USER:STATus?'):
    print('Calibration failed.')
else:
    print('Calibration successful.')
flex.write(':SYSTem:GTLocal')
flex.close()