pylab_ml.scope.lecroy.wavesurfer.wavesurfer3054.Wavesurfer3054

class Wavesurfer3054(addr=None, interface=None, hostname=None, port=None, instName=None)[source]

Bases: WavesurferLecroyGenericScope

“ Interface to LeCroy Wavesurfer 3054 Oscilloscope.

__init__(addr=None, interface=None, hostname=None, port=None, instName=None)[source]

Initialize the Wavesurfer3054 scope interface.

Parameters:
  • addr (str) – IP address of the scope.

  • interface (Interface) – Interface to use for communication (e.g., Interface.tcpip).

  • hostname (str) – Hostname of the scope (should be LeCroy serial number).

  • port (int) – Port number for communication.

  • instName (str) – Instrument name.

Methods

__init__([addr, interface, hostname, port, ...])

Initialize the Wavesurfer3054 scope interface.

close([force])

Close connection to instrument.

find_names()

find_names() returns list of identifiers strings, lhs of = assignments

fix_lecroy_trig()

Issue on LeCroy-wavesurfer, once active channel changed & used, trigger.

get_waveform([channel])

Get the waveform data from the specified channel and return the time and voltage arrays.

help()

Print the docstring of the instrument class.

identify([showInstName])

Identify message.

init([identify])

Optional init for interlock startup after identification.

message([message])

Send a message to the Lecroy scope.

mqtt_add(client, instrument[, liste, qos])

Add the instrument to mqtt.

mqtt_disconnect()

Remove the instrument from mqtt.

publish(topic, value)

Publish topic as type='cmd' with payload=value.

publish_get(function_name, value)

Publish function_name as type='get' with paylad=value.

publish_set(function_name, value)

Publish function_name as type='set' with paylad=value.

reset()

Reset the Lecroy scope.

setup_inst()

Set up the Lecroy scope with initial settings.

trig_oneshot([timeout])

Trigger a single measurement and wait until it is complete or timeout.

wait_until_idle([delay_ms])

Wait until the Lecroy scope is idle.

Attributes

channel

Get the current channel of the Lecroy scope.

command

id

Get the identification string of the Lecroy scope.

interchoices

memsize

Get the memory size of the Lecroy scope.

mqtt_enable

mqtt_list

mqtt_status

Getter for the mqtt_status.

offs

Get the offset of the current channel.

tdelay

Get the trigger delay of the Lecroy scope.

tdiv

Get the time division of the Lecroy scope.

trace

Get the trace state of the current channel.

trig_channel

Get the trigger channel of the Lecroy scope.

trig_level

Get the trigger level of the Lecroy scope.

trig_mode

Get the trigger mode of the Lecroy scope.

trig_slope

Get the trigger slope of the Lecroy scope.

vdiv

Get the voltage division of the current channel.

waveform

Get the waveform data from the current channel and return the time and voltage arrays.

waveform_dt

Get the waveform data from the current channel and return the voltage, time interval, and time offset.

exception TriggerTimeout

Bases: Exception

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

property channel

Get the current channel of the Lecroy scope.

close(force=False)

Close connection to instrument.

find_names()

find_names() returns list of identifiers strings, lhs of = assignments

Returns:

obj_names – List of identifier strings

Return type:

list of str

fix_lecroy_trig()

Issue on LeCroy-wavesurfer, once active channel changed & used, trigger.

Channel attribute (level & slope) changes are ignored!

get_waveform(channel=None)

Get the waveform data from the specified channel and return the time and voltage arrays.

Parameters:

channel (int or str, optional) – The channel to retrieve the waveform from. If None, uses the current channel (default is None).

Returns:

  • t (np.ndarray) – The time values of the waveform.

  • voltage (np.ndarray) – The voltage values of the waveform.

help()

Print the docstring of the instrument class.

property id

Get the identification string of the Lecroy scope.

identify(showInstName=False)

Identify message.

init(identify=False)

Optional init for interlock startup after identification.

json = <module 'json' from '/home/runner/miniconda3/envs/test/lib/python3.9/json/__init__.py'>
property memsize

Get the memory size of the Lecroy scope.

message(message=None)

Send a message to the Lecroy scope.

mqtt_add(client, instrument, liste='#', qos=0)

Add the instrument to mqtt. Calling from base_instrument, after the instrument (device) has been create. Normally you have not to use this function, only base_instrument use it.

Parameters:
  • client (mqtt_init) – The MQTT client instance to which the instrument should be added.

  • instrument (object) – The instrument to be added to the MQTT client.

  • liste (list or str) – A list of attributes for which MQTT messages should be sent. If set to “#”, all attributes will be included (default: “#”).

  • qos (int) – The Quality of Service level for MQTT messages (default: 0).

Return type:

None

mqtt_disconnect()

Remove the instrument from mqtt. Calling from base_instrument, if the instrument are closing. Normally you have not to use this function, only base_instrument use it.

property mqtt_status

Getter for the mqtt_status.

property offs

Get the offset of the current channel.

publish(topic, value)

Publish topic as type=’cmd’ with payload=value.

Parameters:
  • topic (str) – The name of the topic to publish.

  • value (any) – The value to be published.

Return type:

None

publish_get(function_name, value)

Publish function_name as type=’get’ with paylad=value.

Parameters:
  • function_name (str) – The name of the function to be published as a ‘get’ command.

  • value (any) – The value to be published as the payload of the ‘get’ command.

Return type:

None

publish_set(function_name, value)

Publish function_name as type=’set’ with paylad=value.

Parameters:
  • function_name (str) – The name of the function to be published as a ‘set’ command.

  • value (any) – The value to be published as the payload of the ‘set’ command.

Return type:

None

reset()

Reset the Lecroy scope.

setup_inst()

Set up the Lecroy scope with initial settings.

property tdelay

Get the trigger delay of the Lecroy scope.

property tdiv

Get the time division of the Lecroy scope.

property trace

Get the trace state of the current channel.

property trig_channel

Get the trigger channel of the Lecroy scope.

property trig_level

Get the trigger level of the Lecroy scope.

property trig_mode

Get the trigger mode of the Lecroy scope. Trigger mode is one of {‘AUTO’, ‘NORM’, ‘SINGLE’, ‘STOP’}

trig_oneshot(timeout=1.0)

Trigger a single measurement and wait until it is complete or timeout.

Parameters:

timeout (float) – The maximum time to wait for the measurement to complete, in seconds.

Raises:

TriggerTimeout – If the measurement does not complete within the specified timeout.

property trig_slope

Get the trigger slope of the Lecroy scope.

property vdiv

Get the voltage division of the current channel.

wait_until_idle(delay_ms=5)

Wait until the Lecroy scope is idle.

Parameters:

delay_ms (int) – The delay in milliseconds to wait between checks (default is 5 ms).

Returns:

value – The response from the scope indicating its idle status.

Return type:

str

property waveform

Get the waveform data from the current channel and return the time and voltage arrays.

Returns:

  • t (np.ndarray) – The time values of the waveform.

  • voltage (np.ndarray) – The voltage values of the waveform.

property waveform_dt

Get the waveform data from the current channel and return the voltage, time interval, and time offset.

Returns:

  • voltage (np.ndarray) – The voltage values of the waveform.

  • tdelta (float) – The time interval between samples.

  • toffs (float) – The time offset of the waveform.