lab_driver.rtm3004#

Module Contents#

Classes#

API#

class lab_driver.rtm3004.DriverRTM3004[source]#

Bases: lab_driver.mxo4x.DriverMXO4X

Initialization

Class for handling the Rohde and Schwarz Mixed-Signal Oscilloscope MXO44 in Python

live_command_mode() None[source]#

DEBUGGING - enter statements during the execution of the program using the Python interpreter. Results and errors are printed. Returns: None

test(cmd: str)[source]#

Test any command with the device Args: cmd: Some command to be sent to the device Returns: Result of the command if it was a query, None if it was a write command

get_id(do_print=True) str[source]#

Getting the device ID Args: do_print: optionally print the device ID to stdout Returns: Device ID as a string

serial_start(do_reset=False) None[source]#

Open the serial connection to device if it is found Args: do_reset: reset device during initialisation Returns: None

do_reset() None[source]#

Reset the device, then wait two seconds Returns: None

scale_vertical(scale: float) bool[source]#

Sets the vertical scale (V/div) of all channels on the GUI Args: scale: [0.001,10] Volts per division Returns: True if scale is out of range

scale_horizontal(scale: float) bool[source]#

Sets the horizontal (time) scale of all channels on the GUI Args: scale: [1e-9,50] seconds, 1 ns precision Returns: True if scale is out of range

gen_enable() None[source]#

Enable waveform generator Returns: None

gen_disable() None[source]#

Disable waveform generator Returns: None

gen_function(waveform: str) bool[source]#

Select type of waveform function to be generated (case-insensitive) Args: waveform: SINE/SIN for sine function; SQUARE/SQU for square function; RAMP for ramp function; DC for DC function; PULSE/PULS for pulse function; CARDINAL/SINC for cardinal sine function; ARBITRARY/ARB for arbitrary function Returns: True if waveform function is invalid

gen_frequency(frequency: float) None[source]#

Set frequency of waveform Args: frequency: frequency in Hz, range dependent on function Returns: None

gen_amplitude(amplitude: float) bool[source]#

Set amplitude of waveform Args: amplitude: amplitude in volt from [0.06,6], 0.01 increment Returns: True if amplitude out of range

gen_offset(offset: float) bool[source]#

Set vertical offset of generated waveform Args: offset: vertical offset in volt from [-5,+5], 0.0001 increment Returns: True if offset out of range

gen_preset() None[source]#

Preset the generator to a default setup including following settings: Sine wavefunction, 1 MHz frequency, 1 Vpp amplitude, 500 ns horizontal scale, 0.5 V/div vertical scale
Returns: None

dig_technology(tech: str, logic_channel: int) bool[source]#

Select threshold voltage for various types of circuits and apply it to the whole channel group the indicated logic channel belongs to Args: tech: “TTL” (1.4 V), “ECL” (-1.3 V), “CMOS” (2.5 V) or “MAN”/“MANUAL” logic_channel: 0…15 Returns: True if tech is or logic channel invalid

dig_threshold(threshold: float, logic_channel: int) bool[source]#

Set logical threshold for the nibble (D0…D3, D4…D7, D8…D11, and D12…D15) to which the logic channel belongs Args: threshold: Threshold level in volts logic_channel: 0…15 Returns: True if logic channel is invalid

dig_enable(pod: int)[source]#

Enable a logic pod Args: pod: 1 or 2 for the corresponding logic pod Returns: True if pod number is invalid

dig_disable(pod: int)[source]#

Disable a logic pod Args: pod: 1 or 2 for the corresponding logic pod Returns: True if pod number is invalid

dig_hysteresis(level, logic_channel: int) bool[source]#

Defines the level of the hysteresis to avoid the change of signal states due to noise. The setting applies to the logic pod to which the indicated logic channel belongs. Args: level: “SMALL”, “MEDIUM”, “LARGE” (case-insensitive) or 0, 1, 2 respectively. logic_channel: 0…15 Returns: True if hysteresis level or logic channel is invalid

trig_event_mode(sequence: bool) None[source]#

Select whether to trigger on a single event or a sequence of A and B events. Args: sequence: True to enable sequence trigger of A and B, False for only an A trigger

trig_a_mode(mode: str)[source]#

Set the trigger mode, which determines device behaviour if no trigger occurs. Args: mode: “AUTO” or “NORM”/“NORMAL” (case-insensitive) Returns: True if trigger mode is invalid

trig_b_mode(mode: str) bool[source]#

Set either a time or an event delay after an A trigger before recognising a B trigger Args: mode: “DELAY” or “EVENT” (case-insensitive) Returns: True if trigger mode is invalid

trig_source(source: str, event: int = 1) bool[source]#

Set the trigger source of either the A or B trigger Args: source: “CH1” to “CH4”, “D0” to “D15” for both triggers. A-trigger additionally allows “SBUS1”, “SBUS2”, “EXT” and “LINE”. event: 1 = A-trigger, 2 = B-trigger Returns: True if trigger source is invalid for the given event or event is invalid

trig_delay(delay: float) None[source]#

Sets the time that the instrument waits after an A-trigger until it recognises B-triggers Args: delay: delay in seconds in range [20e-9, 6.871946854] Returns: None

trig_b_trigger_count(count: int) None[source]#

Number of B-trigger conditions that need to happen before the B-trigger is actually triggered. Args: count: number of times B-trigger must occur in sequence from 1 to 65535 Returns: None

trig_find_level() None[source]#

Automatically sets trigger level to half of signal amplitude Returns: None

trig_edge_lowpass(large: bool, small: bool) None[source]#

Set an additional lowpass filter in the trigger path Args: large: True for a 100 MHz lowpass filter, False to disable small: True for a 5 KHz lowpass filter, False to disable Returns: None

trig_edge_noisereject(level: str | int) bool[source]#

Sets a hysteresis range around the trigger level to avoid unwanted triggers by noise oscillations. The value of each hysteresis level depends on the vertical scale. Args: level: “AUTO” = 0, “SMALL” (“S”) = 1, “MEDIUM” (“M”) = 2, “LARGE” (“L”) = 3 Returns: True if level is invalid

trig_edge_coupling(coupling: str) bool[source]#

Sets the coupling for the trigger source (case-insensitive). Args: coupling: “DC” - Direct current coupling. The trigger signal remains unchanged. “AC” - Alternating current coupling. A highpass filter removes the DC offset voltage from the trigger signal. “LFR” - Sets the trigger coupling to high frequency. A 15 kHz highpass filter removes lower frequencies from the trigger signal. Use this mode only with very high frequency signals. Returns: True if coupling mode is invalid

trig_edge_direction(direction: lab_driver.mxo4x.Threeway, event: int = 1) bool[source]#

Set edge direction for trigger Args: direction: NEGATIVE for falling edge, POSITIVE for rising edge, NEUTRAL for either event: 1 = A-trigger, 2 = B-trigger Returns: True if direction or event is invalid

trig_level(level: float, channel: int = 1) bool[source]#

Set the trigger threshold voltage for edge, width, and timeout trigger Args: level: Depends on vertical scale, unit [V] channel: 1…4 are the corresponding analogue channels, 5 is external trigger input Returns: True if channel is invalid

trig_export_source(source: str) bool[source]#
trig_export_on_trigger(state: bool) None[source]#

Decide whether the waveform is saved to a file on a trigger event Args: state: True to export waveform data on trigger, False to do nothing Returns: None

fra_enter()[source]#

Enter frequency response analysis mode. This is done automatically whenever an FRA function is called. Returns: None

fra_exit()[source]#

Exit frequency response analysis mode Returns: None

fra_freq_start(freq: float) bool[source]#

Set the start frequency of the sweep. NOTICE: This function is broken and should not be relied upon. Args: freq: Frequency in Hz Returns: None

fra_freq_stop(freq: float) bool[source]#

Set the stop frequency of the sweep NOTICE: This function is broken and should not be relied upon. Args: freq: Frequency in Hz Returns: None

fra_input_channel(channel: int) bool[source]#

Set the channel used for the input signal of the device Args: channel: 1 to 4 Returns: True for invalid channel number