hvl_ccb.dev.tiepie.oscilloscope¶
- class TiePieOscilloscope(com, dev_config)[source]¶
Bases:
hvl_ccb.dev.base.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” and “I2CHost”, are 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: Optional[Union[int, float]] = 0) Optional[numpy.ndarray] [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[hvl_ccb.dev.tiepie.base.TiePieDeviceConfig] [source]¶
Return the default configdataclass class.
- Returns
a reference to the default configdataclass class
- config_osc: Optional[hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeConfig]¶
Oscilloscope’s dynamical configuration.
- config_osc_channel_dict: Dict[int, hvl_ccb.dev.tiepie.channel.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[hvl_ccb.comm.base.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_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() libtiepie.devicelist.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 or status of underlying device gives an error
- class TiePieOscilloscopeAutoResolutionModes(value=<no_arg>, names=None, module=None, type=None, start=1, boundary=None)[source]¶
Bases:
hvl_ccb.utils.enum.NameEnum
An enumeration.
- ALL = 4¶
- DISABLED = 1¶
- NATIVEONLY = 2¶
- UNKNOWN = 0¶
- class TiePieOscilloscopeConfig(dev_osc: libtiepie.oscilloscope.Oscilloscope)[source]¶
Bases:
hvl_ccb.dev.tiepie.utils.PublicPropertiesReprMixin
Oscilloscope’s configuration with cleaning of values in properties setters.
- property auto_resolution_mode: hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeAutoResolutionModes¶
- static clean_auto_resolution_mode(auto_resolution_mode: Union[int, hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeAutoResolutionModes]) hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeAutoResolutionModes [source]¶
- static clean_resolution(resolution: Union[int, hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeResolution]) hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeResolution [source]¶
- property pre_sample_ratio: float¶
- property record_length: int¶
- property resolution: hvl_ccb.dev.tiepie.oscilloscope.TiePieOscilloscopeResolution¶
- property sample_frequency: float¶
- property trigger_timeout: Optional[float]¶