dwfpy.digital_input.DigitalInput
- class DigitalInput(device)[source]
Bases:
objectDigital Input module (Logic Analyzer).
Methods
Configures the instrument and starts the acquisition..
Gets the acquired data samples.
Gets the acquired noise samples.
Gets the acquisition state and optionally reads the data.
Starts a data recording.
Resets and configures all instrument parameters to default values.
Sets up a new data acquisition.
Sets up a counter trigger.
Sets up an edge trigger.
Sets up a glitch trigger.
Sets up a length trigger.
Sets up a level trigger.
Sets up a more trigger.
Sets up a timeout trigger.
Sets up the trigger condition.
Starts a single data acquisition.
Streams data to a callback function.
Waits for the specified acquisition state.
Attributes
Gets or sets the acquisition mode.
Gets the supported acquisition modes.
Returns True if the acquisition is auto triggered.
Gets or sets the buffer size.
Gets the maximum supported buffer size.
Gets a collection of Digital Input channels.
Gets the clock unit.
Gets the device.
Gets or sets a value indicating if DIO pins will be placed in front of the DIN pins.
Gets information about the recording process.
Gets the number of samples left in the acquisition.
Gets or sets the number of bits to be sampled.
Gets or sets the sample mode.
Gets the supported sample modes.
Gets or sets the sample rate.
Gets or sets the signals to be used for data compression in record acquisition mode.
Returns instrument trigger time information.
Gets the trigger unit.
Gets the number of valid/acquired data samples.
Gets the buffer write pointer which is needed in scan_screen acquisition mode to display the scan bar.
- property acquisition_mode: AcquisitionMode
Gets or sets the acquisition mode.
- Return type
- property acquisition_mode_info: Tuple[AcquisitionMode, ...]
Gets the supported acquisition modes.
- Return type
Tuple[AcquisitionMode,...]
- property auto_triggered: bool
Returns True if the acquisition is auto triggered.
- Return type
bool
- property buffer_size: int
Gets or sets the buffer size.
- Return type
int
- property buffer_size_max: int
Gets the maximum supported buffer size.
- Return type
int
- property channels
Gets a collection of Digital Input channels.
- property clock: DigitalInputClock
Gets the clock unit.
- Return type
- configure(reconfigure=False, start=False)[source]
Configures the instrument and starts the acquisition..
- Return type
None
- property dio_first: bool
Gets or sets a value indicating if DIO pins will be placed in front of the DIN pins.
- Return type
bool
- get_data(first_sample=0, sample_count=- 1)[source]
Gets the acquired data samples.
Before calling this function, call the ‘read_status()’ function to read the data from the device.
- get_noise(first_sample=0, sample_count=- 1)[source]
Gets the acquired noise samples.
Before calling this function, call the ‘read_status()’ function to read the data from the device.
- read_status(read_data=False)[source]
Gets the acquisition state and optionally reads the data.
- Return type
- record(sample_rate=None, sample_format=None, sample_sensible=None, sample_count=None, prefill=None, callback=None, configure=False, start=False)[source]
Starts a data recording.
- sample_ratefloat, optional
The sampling frequency in Hz.
- sample_formatint, optional
The number of bits to be sampled. Can be 8, 16, or 32.
- sample_sensibleint, optional
The signals to be used for data compression, as a bit-mask.
- sample_countint or float, optional
The number of samples to be acquired after the trigger.
- prefillint or float, optional
The number of samples to be acquired before the trigger.
- callbackfunction, optional
A custom function to monitor the recording process.
- configurebool, optional
If True, then the instrument is configured (default False).
- startbool, optional
If True, then the recording is started (default False).
- DigitalRecorder
The recorder instance.
- Return type
- property record_status: Tuple[int, int, int]
Gets information about the recording process. Returns (available_samples, lost_samples, corrupted_samples)
- Return type
Tuple[int,int,int]
- property remaining_samples: int
Gets the number of samples left in the acquisition.
- Return type
int
- reset()[source]
Resets and configures all instrument parameters to default values.
- Return type
None
- property sample_format: int
Gets or sets the number of bits to be sampled. Can be 8, 16, or 32.
- Return type
int
- property sample_mode: DigitalInputSampleMode
Gets or sets the sample mode.
- Return type
- property sample_mode_info: Tuple[DigitalInputSampleMode, ...]
Gets the supported sample modes.
- Return type
Tuple[DigitalInputSampleMode,...]
- property sample_rate: float
Gets or sets the sample rate.
- Return type
float
- property sample_sensible: int
Gets or sets the signals to be used for data compression in record acquisition mode.
- Return type
int
- setup_acquisition(mode=None, sample_rate=None, sample_format=None, buffer_size=None, position=None, prefill=None, configure=False, start=False)[source]
Sets up a new data acquisition.
- modestr, optional
The sampling mode. Can be ‘single’, ‘scan-shift’, ‘scan-screen’, or ‘record’.
- sample_ratefloat, optional
The sampling frequency in Hz.
- sample_formatint, optional
The number of bits to be sampled. Can be 8, 16, or 32.
- buffer_sizeint or float, optional
The buffer size.
- positionint or float, optional
The number of samples to be acquired after the trigger.
- prefillint or float, optional
The number of samples to be acquired before the trigger (record mode only).
- configurebool, optional
If True, then the instrument is configured (default False).
- startbool, optional
If True, then the acquisition is started (default False).
- Return type
None
- setup_counter_trigger(channel, condition, reset_channel, reset_condition, max_counter)[source]
Sets up a counter trigger.
- channelint
The trigger channel.
- conditionstr
The trigger condition. Can be ‘ignore’, ‘low’, ‘high’, ‘rise’, ‘fall’, or ‘edge’.
- reset_channelint
The counter reset channel.
- reset_conditionstr
The reset condition. Can be ‘ignore’, ‘low’, ‘high’, ‘rise’, ‘fall’, or ‘edge’.
- max_counterint
The maximum counter value.
- Return type
None
- setup_edge_trigger(channel, edge)[source]
Sets up an edge trigger.
- channelint
The trigger channel.
- edgestr
The trigger edge. Can be ‘rising’ or ‘falling’.
- Return type
None
- setup_glitch_trigger(channel, polarity, less_than)[source]
Sets up a glitch trigger.
- channelint
The trigger channel.
- polaritystr
The trigger polarity. Can be ‘positive’ or ‘negative’.
- less_thanfloat
The maximum pulse width in seconds.
- Return type
None
- setup_length_trigger(channel, polarity, length, hysteresis=0.0)[source]
Sets up a length trigger.
- channelint
The trigger channel.
- polaritystr
The trigger polarity. Can be ‘positive’ or ‘negative’.
- lengthfloat
The minimum pulse width in seconds.
- hysteresisfloat, optional
The pulse width hysteresis in seconds.
- Return type
None
- setup_level_trigger(channel, level)[source]
Sets up a level trigger.
- channelint
The trigger channel.
- levelstr
The trigger level. Can be ‘low’ or ‘high’.
- Return type
None
- setup_more_trigger(channel, polarity, more_than)[source]
Sets up a more trigger.
- channelint
The trigger channel.
- polaritystr
The trigger polarity. Can be ‘positive’ or ‘negative’.
- more_thanfloat
The minimum pulse width in seconds.
- Return type
None
- setup_timeout_trigger(channel, polarity, more_than)[source]
Sets up a timeout trigger.
- channelint
The trigger channel.
- polaritystr
The trigger polarity. Can be ‘positive’ or ‘negative’.
- more_thanfloat
The minimum pulse width in seconds.
- Return type
None
- setup_trigger(source=None, slope=None, position=None, prefill=None, auto_timeout=None)[source]
Sets up the trigger condition.
- sourcestr, optional
The trigger source. Can be ‘none’, ‘pc’, ‘detector-analog-in’, ‘detector-digital-in’, ‘analog-in’, ‘digital-in’, ‘digital-out’, ‘analog-out1’, ‘analog-out2’, ‘analog-out3’, ‘analog-out3’, ‘external1’, ‘external2’, ‘external3’, ‘external4’, ‘low’, ‘high’, or ‘clock’.
- slopestr, optional
The trigger slope. Can be ‘rising’, ‘falling’, or ‘either’.
- positionint, optional
The number of samples to be acquired after the trigger.
- prefillint, optional
The number of samples to be acquired before the trigger.
- auto_timeoutfloat, optional
The auto trigger timeout in seconds.
- Return type
None
- single(sample_rate=None, sample_format=None, buffer_size=None, position=None, continuous=True, configure=False, start=False)[source]
Starts a single data acquisition.
- sample_ratefloat, optional
The sampling frequency in Hz.
- sample_formatint, optional
The number of bits to be sampled. Can be 8, 16, or 32.
- buffer_sizeint or float, optional
The buffer size.
- positionint or float, optional
The number of samples to be acquired after the trigger.
- continuousbool, optional
If True, then the instrument is rearmed after the data is retrieved. (default True).
- configurebool, optional
If True, then the instrument is configured (default False).
- startbool, optional
If True, then the acquisition is started (default False).
- tuple
If
startis True, a tuple of integers containing the data samples. None otherwise.
- Return type
Optional[Tuple]
- stream(callback, sample_rate=None, sample_format=None, sample_sensible=None, configure=False, start=False)[source]
Streams data to a callback function.
- callbackfunction
A user-defined function to receive the streaming data.
- sample_ratefloat, optional
The sampling frequency in Hz.
- sample_formatint, optional
The number of bits to be sampled. Can be 8, 16, or 32.
- sample_sensibleint, optional
The signals to be used for data compression.
- configurebool, optional
If True, then the instrument is configured (default False).
- startbool, optional
If True, then the streaming is started (default False).
- DigitalRecorder
The recorder instance.
- Return type
- property time: None
Returns instrument trigger time information.
- Return type
None
- property trigger: DigitalInputTrigger
Gets the trigger unit.
- Return type
- property valid_samples: int
Gets the number of valid/acquired data samples.
- Return type
int
- wait_for_status(status, read_data=False)[source]
Waits for the specified acquisition state.
- Return type
None
- property write_index: int
Gets the buffer write pointer which is needed in scan_screen acquisition mode to display the scan bar.
- Return type
int