hvl_ccb.dev.tiepie.oscilloscope
- class TiePieOscilloscope(com, dev_config)[source]
Bases:
SingleCommDevice
TiePie oscilloscope.
A wrapper for TiePie oscilloscopes, based on the class libtiepie.oscilloscope.Oscilloscope with simplifications for starting of the device (using serial number) and managing mutable configuration of both the device and its channels, including extra validation and typing hints support for configurations.
Note that, in contrast to libtiepie library, since all physical TiePie devices include an oscilloscope, this is the base class for all physical TiePie devices. The additional TiePie sub-devices: “Generator” is mixed-in to this base class in subclasses.
The channels use 1..N numbering (not 0..N-1), as in, e.g., the Multi Channel software.
- property channels_enabled: Generator[int, None, None]
Yield numbers of enabled channels.
- Returns:
Numbers of enabled channels
- collect_measurement_data(timeout: int | float | None = 0) ndarray[Any, dtype[_ScalarType_co]] | None [source]
Try to collect the data from TiePie; return None if data is not ready.
- Parameters:
timeout – The timeout to wait until data is available. This option makes this function blocking the code. timeout = None blocks the code infinitely till data will be available. Per default, the timeout is set to 0: The function will not block.
- Returns:
Measurement data of only enabled channels and time vector in a 2D-numpy.ndarray with float sample data; or None if there is no data available.
- static config_cls() type[TiePieDeviceConfig] [source]
Return the default configdataclass class.
- Returns:
a reference to the default configdataclass class
- config_osc: TiePieOscilloscopeConfig | None
Oscilloscope’s dynamical configuration.
- config_osc_channel_dict: dict[int, TiePieOscilloscopeChannelConfig]
Channel configuration. A dict mapping actual channel number, numbered 1..N, to channel configuration. The channel info is dynamically read from the device only on the first start(); beforehand the dict is empty.
- static default_com_cls() type[NullCommunicationProtocol] [source]
Get the class for the default communication protocol used with this device.
- Returns:
the type of the standard communication protocol for this device
- force_trigger() None [source]
Forces the TiePie to trigger with a software sided trigger event.
- Return None:
- Raises:
TiePieError – when device is not started or status of underlying device gives an error
- is_measurement_data_ready() bool [source]
Reports if TiePie has data which is ready to collect
- Returns:
if the data is ready to collect.
- Raises:
TiePieError – when device is not started or status of underlying device gives an error
- is_measurement_running() bool [source]
Reports if TiePie measurement is running (ready for trigger)
- Returns:
if a TiePie measurement is running (ready for trigger)
- is_triggered() bool [source]
Reports if TiePie has triggered. Maybe data is not yet available. One can check with the function is_measurement_data_ready().
- Returns:
if a trigger event occurred
- static list_devices() DeviceList [source]
List available TiePie devices.
- Returns:
libtiepie up to date list of devices
- property n_channels
Number of channels in the oscilloscope.
- Returns:
Number of channels.
- start_measurement() None [source]
Start a measurement using set configuration.
- Raises:
TiePieError – when device is not started, when measurement is already
running, or when status of underlying device gives an error.
- stop_measurement() None [source]
Stop a measurement that is already running.
- Raises:
TiePieError – when device is not started, when measurement is not
running, or when status of underlying device gives an error
- class TiePieOscilloscopeAutoResolutionModes(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
NameEnum
An enumeration.
- ALL = 4
- DISABLED = 1
- NATIVEONLY = 2
- UNKNOWN = 0
- class TiePieOscilloscopeConfig(dev_osc: Oscilloscope)[source]
Bases:
PublicPropertiesReprMixin
Oscilloscope’s configuration with cleaning of values in properties setters.
- property auto_resolution_mode: TiePieOscilloscopeAutoResolutionModes
- static clean_auto_resolution_mode(auto_resolution_mode: int | TiePieOscilloscopeAutoResolutionModes) TiePieOscilloscopeAutoResolutionModes [source]
- static clean_resolution(resolution: int | TiePieOscilloscopeResolution) TiePieOscilloscopeResolution [source]
- property pre_sample_ratio: float
- property record_length: int
- property resolution: TiePieOscilloscopeResolution
- property sample_frequency
For backwards compatibility. Use sample_rate instead
- property sample_rate: float