This notebook is indendet to give an overview over the functions implemented in the QCoDeS driver for the Keysight Infinium Oscilloscopes. The driver has been tested with the MSOS104A. Please note that the oscilloscopes have plenty of more functions, that have not yet been implemented. Feel free to contribute, request features or report bugs.
%matplotlib inline
# python imports
import logging
# third party
import matplotlib.pyplot as plt
# qcodes imports
import qcodes as qc
import qcodes.instrument_drivers.Keysight.Infiniium as MSO
from qcodes.plots.qcmatplotlib import MatPlot
from qcodes.measure import Measure
#setup
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
Logging hadn't been started. Activating auto-logging. Current session state plus future input saved. Filename : C:\Users\Jens-Work\.qcodes\logs\command_history.log Mode : append Output logging : True Raw input log : False Timestamping : True State : active Qcodes Logfile : C:\Users\Jens-Work\.qcodes\logs\201006-15096-qcodes.log
please insert the right address of your local scope (TCPIP...) you can find the address with the NI-MAX app or within the network settings of the scope.
mso = MSO.Infiniium('MSO', 'TCPIP0::A-PCSERNO-47466::inst0::INSTR')
Connected to: KEYSIGHT TECHNOLOGIES MSOS104A (serial:MY55510104, firmware:06.00.00901) in 0.04s
In this example we are going to acquire the a 100kHz sine wave with 1Vpp from a waveform generator at connected to channel 4 of the scope. Therefore:
for i in range(4):
mso.channels[i].display(False)
mso.ch4.display(True)
mso.timebase_range(10e-3)
mso.timebase_position(5e-3)
mso.ch4.range(1.2)
we want to use the input signal itself as the trigger. Therefor the trigger is first enabled, the trigger source is set and we raise the level to 0.4 V, just for avoiding a boring symmetric function.
mso.trigger_enabled(True)
mso.trigger_edge_source('CHANnel4')
mso.trigger_edge_slope('negative')
mso.ch4.trigger_level(0.4)
We are going to acquire 100k datapoints with 16bit depth over one periode. So we need a sample rate of 10 MS/s.
nPoints = 100000;
mso.acquire_points(nPoints)
mso.acquire_sample_rate(nPoints/mso.timebase_range())
It is important to remember to prepare the trace before acquisition.
mso.ch4.trace.prepare_curvedata()
Then the parameter can be acquire as usual
data = Measure(mso.ch4.trace).run()
DataSet: location = 'data/2017-10-18/#003_{name}_13-49-46' <Type> | <array_id> | <array.name> | <array.shape> Measured | MSO_chan4_trace | trace | (100000,) acquired at 2017-10-18 13:49:47
The data looks as expected (hopefully)
plot = MatPlot(data.arrays['MSO_chan4_trace'])