Teledyne-LeCroy¶
MAUI
Oscilloscope Controller¶
- class instruments.teledyne.MAUI(filelike)[source]¶
Medium to high-end Teledyne-Lecroy Oscilloscopes are shipped with the MAUI user interface. This class can be used to communicate with these instruments.
By default, the IEEE 488.2 commands are used. However, commands based on MAUI’s
app
definition can be submitted too using the appropriate send / query commands.Your scope must be set up to communicate via LXI (VXI11) to be used with pyvisa. Make sure that either the pyvisa-py or the NI-VISA backend is installed. Please see the pyvisa documentation for more information.
This class inherits from:
Oscilloscope
- Example usage (more examples below):
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> # start the trigger in automatic mode >>> inst.run() >>> print(inst.trigger_state) # print the trigger state <TriggerState.auto: 'AUTO'> >>> # set timebase to 20 ns per division >>> inst.time_div = u.Quantity(20, u.ns) >>> # call the first oscilloscope channel >>> channel = inst.channel[0] >>> channel.trace = True # turn the trace on >>> channel.coupling = channel.Coupling.dc50 # coupling to 50 Ohm >>> channel.scale = u.Quantity(1, u.V) # vertical scale to 1V/division >>> # transfer a waveform into xdat and ydat: >>> xdat, ydat = channel.read_waveform()
- class Channel(parent, idx)[source]¶
Class representing a channel on a MAUI oscilloscope.
Warning
This class should NOT be manually created by the user. It is designed to be initialized by the
MAUI
class.- class Coupling(value)[source]¶
Enum containing valid coupling modes for the oscilloscope channel. 1 MOhm and 50 Ohm are included.
- ac1M = 'A1M'¶
- dc1M = 'D1M'¶
- dc50 = 'D50'¶
- ground = 'GND'¶
- query(cmd, size=-1)[source]¶
Executes the given query. Wraps commands sent from property factories in this class with identifiers for the specified channel.
- sendcmd(cmd)[source]¶
Wraps commands sent from property factories in this class with identifiers for the specified channel.
- Parameters:
cmd (str) – Command to send to the instrument
- property coupling¶
Gets/sets the coupling for the specified channel.
Example usage:
>>> import instruments as ik >>> address = "TCPIP0::192.168.0.10::INSTR" >>> inst = inst = ik.teledyne.MAUI.open_visa(address) >>> channel = inst.channel[0] >>> channel.coupling = channel.Coupling.dc50
- property offset¶
Sets/gets the vertical offset of the specified input channel.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> channel = inst.channel[0] # set up channel >>> channel.offset = u.Quantity(-1, u.V)
- property scale¶
Sets/Gets the vertical scale of the channel.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> channel = inst.channel[0] # set up channel >>> channel.scale = u.Quantity(20, u.mV)
- class DataSource(parent, name)[source]¶
Class representing a data source (channel, math, ref) on a MAUI oscilloscope.
Warning
This class should NOT be manually created by the user. It is designed to be initialized by the
MAUI
class.- read_waveform(bin_format=False, single=True)[source]¶
Reads the waveform and returns an array of floats with the data.
- Parameters:
bin_format (bool) – Not implemented, always False
single (bool) – Run a single trigger? Default True. In case a waveform from a channel is required, this option is recommended to be set to True. This means that the acquisition system is first stopped, a single trigger is issued, then the waveform is transfered, and the system is set back into the state it was in before. If sampling math with multiple samples, set this to false, otherwise the sweeps are cleared by the oscilloscope prior when a single trigger command is issued.
- Returns:
Data (time, signal) where time is in seconds and signal in V
- Return type:
tuple`[`tuple`[`~pint.Quantity
, …],tuple`[`~pint.Quantity
, …]] or if numpy is installed,tuple`[`numpy.array
,numpy.array
]- Raises:
NotImplementedError – Bin format was chosen, but it is not implemented.
- Example usage:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> channel = inst.channel[0] # set up channel >>> xdat, ydat = channel.read_waveform() # read waveform
- property trace¶
Gets/Sets if a given trace is turned on or off.
Example usage:
>>> import instruments as ik >>> address = "TCPIP0::192.168.0.10::INSTR" >>> inst = inst = ik.teledyne.MAUI.open_visa(address) >>> channel = inst.channel[0] >>> channel.trace = False
- class Math(parent, idx)[source]¶
Class representing a function on a MAUI oscilloscope.
Warning
This class should NOT be manually created by the user. It is designed to be initialized by the
MAUI
class.- class Operators(parent)[source]¶
Sets the operator for a given channel. Most operators need a source
src
. If the source is given as an integer, it is assume that the a signal channel is requested. If you want to select another math channel for example, you will need to specify the source as a tuple: Example:src=('f', 0)
would represent the first function channel (called F1 in the MAUI manual). A channel could be selected by callingsrc=('c', 1)
, which would request the second channel (oscilloscope channel 2). Please consult the oscilloscope manual / the math setup itself for further possibilities.Note
Your oscilloscope might not have all functions
that are described here. Also: Not all possibilities are currently implemented. However, extension of this functionality should be simple when following the given structure
- derivative(src, vscale=1000000.0, voffset=0, autoscale=True)[source]¶
Derivative of waveform using subtraction of adjacent samples. If vscale and voffset are unitless, V/s are assumed.
- envelope(src, sweeps=1000, limit_sweeps=True)[source]¶
Highest and lowest Y values at each X in N sweeps.
- fft(src, type='powerspectrum', window='vonhann', suppress_dc=True)[source]¶
Fast Fourier Transform of signal.
- Parameters:
type (str) – Type of power spectrum. Possible options are: [‘real’, ‘imaginary’, ‘magnitude’, ‘phase’, ‘powerspectrum’, ‘powerdensity’]. Default: ‘powerspectrum’
window (str) – Window. Possible options are: [‘blackmanharris’, ‘flattop’, ‘hamming’, ‘rectangular’, ‘vonhann’]. Default: ‘vonhann’
suppress_dc (bool) – Supress DC?
- floor(src, sweeps=1000, limit_sweeps=True)[source]¶
Lowest vertical value at each X value in N sweeps.
- rescale(src, multiplier=1, adder=0)[source]¶
Rescales the waveform (w) in the style. multiplier * w + adder
- roof(src, sweeps=1000, limit_sweeps=True)[source]¶
Highest vertical value at each X value in N sweeps.
- property current_setting¶
Gets the current setting and returns it as the full command, as sent to the scope when setting an operator.
- query(cmd, size=-1)[source]¶
Executes the given query. Wraps commands sent from property factories in this class with identifiers for the specified channel.
- sendcmd(cmd)[source]¶
Wraps commands sent from property factories in this class with identifiers for the specified channel.
- Parameters:
cmd (str) – Command to send to the instrument
- property operator¶
Get an operator object to set use to do math.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> channel = inst.channel[0] # set up channel >>> # set up the first math function >>> function = inst.math[0] >>> function.trace = True # turn the trace on >>> # set function to average the first oscilloscope channel >>> function.operator.average(0)
- class Measurement(parent, idx)[source]¶
Class representing a measurement on a MAUI oscilloscope.
Warning
This class should NOT be manually created by the user. It is designed to be initialized by the
MAUI
class.- class State(value)[source]¶
Enum class for Measurement Parameters. Required to turn it on or off.
- both = 'CUST,BOTH'¶
- histogram_icon = 'CUST,HISTICON'¶
- off = 'CUST,OFF'¶
- statistics = 'CUST,STAT'¶
- query(cmd, size=-1)[source]¶
Executes the given query. Wraps commands sent from property factories in this class with identifiers for the specified channel.
- sendcmd(cmd)[source]¶
Wraps commands sent from property factories in this class with identifiers for the specified channel.
- Parameters:
cmd (str) – Command to send to the instrument
- set_parameter(param, src)[source]¶
Sets a given parameter that should be measured on this given channel.
- Parameters:
param (inst.MeasurementParameters) – The parameter to set from the given enum list.
src (int,tuple) – Source, either as an integer if a channel is requested (e.g., src=0 for Channel 1) or as a tuple in the form, e.g., (‘F’, 1). Here ‘F’ refers to a mathematical function and 1 would take the second mathematical function
F2
.
- Raises:
AttributeError – The chosen parameter is invalid.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> msr1 = inst.measurement[0] # set up first measurement >>> # setup to measure the 10 - 90% rise time on first channel >>> msr1.set_parameter(inst.MeasurementParameters.rise_time_10_90, 0)
- property measurement_state¶
Sets / Gets the measurement state. Valid values are ‘statistics’, ‘histogram_icon’, ‘both’, ‘off’.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> msr1 = inst.measurement[0] # set up first measurement >>> msr1.measurement_state = msr1.State.both # set to `both`
- property statistics¶
Gets the statistics for the selected parameter. The scope must be in
My_Measure
mode.- Return tuple:
(average, low, high, sigma, sweeps)
- Return type:
(float, float, float, float, float)
- class MeasurementParameters(value)[source]¶
Enum containing valid measurement parameters that only require one or more sources. Only single source parameters are currently implemented.
- amplitude = 'AMPL'¶
- area = 'AREA'¶
- base = 'BASE'¶
- delay = 'DLY'¶
- duty_cycle = 'DUTY'¶
- fall_time_80_20 = 'FALL82'¶
- fall_time_90_10 = 'FALL'¶
- frequency = 'FREQ'¶
- maximum = 'MAX'¶
- mean = 'MEAN'¶
- minimum = 'MIN'¶
- none = 'NULL'¶
- overshoot_neg = 'OVSN'¶
- overshoot_pos = 'OVSP'¶
- peak_to_peak = 'PKPK'¶
- period = 'PER'¶
- phase = 'PHASE'¶
- rise_time_10_90 = 'RISE'¶
- rise_time_20_80 = 'RISE28'¶
- rms = 'RMS'¶
- stdev = 'SDEV'¶
- top = 'TOP'¶
- width_50_neg = 'WIDN'¶
- width_50_pos = 'WID'¶
- class TriggerSource(value)[source]¶
Enum containing valid trigger sources.
This is an enum for the default values.
Note
This class is initialized like this for four channels, which is the default setting. If you change the number of channels,
TriggerSource
will be recreated using the routine_create_trigger_source_enum
. This will make further channels available to you or remove channels that are not present in your setup.- c0 = 'C1'¶
- c1 = 'C2'¶
- c2 = 'C3'¶
- c3 = 'C4'¶
- etm10 = 'ETM10'¶
- ext = 'EX'¶
- ext10 = 'EX10'¶
- ext5 = 'EX5'¶
- line = 'LINE'¶
- class TriggerState(value)[source]¶
Enum containing valid trigger state for the oscilloscope.
- auto = 'AUTO'¶
- normal = 'NORM'¶
- single = 'SINGLE'¶
- stop = 'STOP'¶
- class TriggerType(value)[source]¶
Enum containing valid trigger state.
Availability depends on oscilloscope options. Please consult your manual. Only simple types are currently included.
Warning
Some of the trigger types are untested and might need further parameters in order to be appropriately set.
- dropout = 'DROPOUT'¶
- edge = 'EDGE'¶
- glitch = 'GLIT'¶
- interval = 'INTV'¶
- pattern = 'PA'¶
- qualified = 'TEQ'¶
- runt = 'RUNT'¶
- slew_rate = 'SLEW'¶
- tv = 'TV'¶
- width = 'WIDTH'¶
- clear_sweeps()[source]¶
Clears the sweeps in a measurement.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.clear_sweeps()
- force_trigger()[source]¶
Forces a trigger event to occur on the attached oscilloscope.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.force_trigger()
- run()[source]¶
Enables the trigger for the oscilloscope and sets it to auto.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.run()
- stop()[source]¶
Disables the trigger for the oscilloscope.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.stop()
- property channel¶
Gets an iterator or list for easy Pythonic access to the various channel objects on the oscilloscope instrument.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> channel = inst.channel[0] # get first channel
- property math¶
Gets an iterator or list for easy Pythonic access to the various math data sources objects on the oscilloscope instrument.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> math = inst.math[0] # get first math function
- property measurement¶
Gets an iterator or list for easy Pythonic access to the various measurement data sources objects on the oscilloscope instrument.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> msr = inst.measurement[0] # get first measurement parameter
- property number_channels¶
Sets/Gets the number of channels available on the specific oscilloscope. Defaults to 4.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.number_channel = 2 # for a oscilloscope with 2 channels >>> inst.number_channel 2
- property number_functions¶
Sets/Gets the number of functions available on the specific oscilloscope. Defaults to 2.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.number_functions = 4 # for a oscilloscope with 4 math functions >>> inst.number_functions 4
- property number_measurements¶
Sets/Gets the number of measurements available on the specific oscilloscope. Defaults to 6.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.number_measurements = 4 # for a oscilloscope with 4 measurements >>> inst.number_measurements 4
- property ref¶
Gets an iterator or list for easy Pythonic access to the various ref data sources objects on the oscilloscope instrument. Typically generated by the
ProxyList
helper.
- property self_test¶
Runs an oscilloscope’s internal self test and returns the result. The self-test includes testing the hardware of all channels, the timebase and the trigger circuits. Hardware failures are identified by a unique binary code in the returned <status> number. A status of 0 indicates that no failures occurred.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.self_test()
- property show_id¶
Gets the scope information and returns it. The response comprises manufacturer, oscilloscope model, serial number, and firmware revision level.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.show_id()
- property show_options¶
Gets and returns oscilloscope options: installed software or hardware that is additional to the standard instrument configuration. The response consists of a series of response fields listing all the installed options.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.show_options()
- property time_div¶
Sets/Gets the time per division, modifies the timebase setting. Unitful.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.time_div = u.Quantity(200, u.ns)
- property trigger_delay¶
Sets/Gets the trigger offset with respect to time zero (i.e., a horizontal shift). Unitful.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.trigger_delay = u.Quantity(60, u.ns)
- property trigger_source¶
Sets / Gets the trigger source.
Note
The
TriggerSource
class is dynamically generatedwhen the number of channels is switched. The above shown class is only the default! Channels are added and removed, as required.
Warning
If a trigger type is currently set on the oscilloscope that is not implemented in this class, setting the source will fail. The oscilloscope is set up such that the the trigger type and source are set at the same time. However, for convenience, these two properties are split apart here.
- Returns:
Trigger source.
- Return type:
Member of
TriggerSource
class.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.trigger_source = inst.TriggerSource.ext # external trigger
- property trigger_state¶
Sets / Gets the trigger state. Valid values are are defined in
TriggerState
enum class.- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.trigger_state = inst.TriggerState.normal
- property trigger_type¶
Sets / Gets the trigger type.
Warning
If a trigger source is currently set on the oscilloscope that is not implemented in this class, setting the source will fail. The oscilloscope is set up such that the the trigger type and source are set at the same time. However, for convenience, these two properties are split apart here.
- Returns:
Trigger type.
- Return type:
Member of
TriggerType
enum class.
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.teledyne.MAUI.open_visa("TCPIP0::192.168.0.10::INSTR") >>> inst.trigger_type = inst.TriggerType.edge # trigger on edge