dwfpy.analog_input.AnalogInput

class AnalogInput(device)[source]

Bases: object

Analog Input module (Oscilloscope).

Methods

configure

Configures the instrument and optionally starts the acquisition.

force_trigger

Force trigger of instrument.

read_status

Gets the acquisition state and optionally reads the data.

record

Starts a data recording.

reset

Resets and configures all instrument parameters to default values.

scan_screen

Starts a scan-screen data acquisition.

scan_shift

Starts a scan-shift data acquisition.

setup_acquisition

Sets up a new data acquisition.

setup_channel

Sets up a channel for data acquisition.

setup_edge_trigger

Trigger upon a certain voltage level in the positive or negative slope of the waveform.

setup_pulse_trigger

Trigger upon a positive or negative pulse width when measured at a certain voltage level.

setup_transition_trigger

Sets up a transition trigger.

setup_window_trigger

Trigger upon a signal entering or exiting a window at certain voltage thresholds.

single

Starts a single data acquisition.

wait_for_status

Waits for the specified acquisition state.

Attributes

acquisition_mode

Gets or sets the acquisition mode.

acquisition_mode_info

Gets the supported acquisition modes.

auto_triggered

Returns True if the acquisition is auto triggered.

buffer_size

Gets or sets the buffer size.

buffer_size_max

Gets the maximum supported buffer size.

buffer_size_min

Gets the minimum supported buffer size.

channels

Gets a collection of Analog Input channels.

counter

Gets or sets the current timeout in seconds.

counter_max

Gets the maximum count value.

counter_status

Gets the count, frequency and tick values.

device

Gets the device.

frequency

Gets or sets the configured sample frequency in Hz.

frequency_max

Gets the maximum supported sample frequency.

frequency_min

Gets the minimum supported sample frequency.

noise_buffer_size

Gets or sets the noise buffer size.

noise_buffer_size_max

Gets the maximum supported noise buffer size.

record_length

Gets or sets the record length in seconds.

record_status

Gets information about the recording process: Returns (available_samples, lost_samples, corrupted_samples)

remaining_samples

Gets the number of samples left in the acquisition.

time

Gets instrument trigger time information.

timeout_max

Gets the maximum timeout value.

trigger

Gets the trigger unit.

valid_samples

Gets the number of valid/acquired data samples.

write_index

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

AcquisitionMode

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.

Before calling this function, call the ‘read_status()’ function to read the data from the device.

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 buffer_size_min: int

Gets the minimum supported buffer size.

Return type

int

property channels: Tuple[AnalogInputChannel, ...]

Gets a collection of Analog Input channels.

Return type

Tuple[AnalogInputChannel, ...]

configure(reconfigure=False, start=False)[source]

Configures the instrument and optionally starts the acquisition.

Return type

None

property counter: float

Gets or sets the current timeout in seconds.

Return type

float

property counter_max: float

Gets the maximum count value.

Return type

float

property counter_status: Tuple[float, float, int]

Gets the count, frequency and tick values.

Return type

Tuple[float, float, int]

property device: Device

Gets the device.

Return type

Device

force_trigger()[source]

Force trigger of instrument.

Return type

None

property frequency: float

Gets or sets the configured sample frequency in Hz.

Return type

float

property frequency_max: float

Gets the maximum supported sample frequency.

Return type

float

property frequency_min: float

Gets the minimum supported sample frequency.

Return type

float

property noise_buffer_size: int

Gets or sets the noise buffer size.

Return type

int

property noise_buffer_size_max: int

Gets the maximum supported noise buffer size.

Return type

int

read_status(read_data=False)[source]

Gets the acquisition state and optionally reads the data.

Return type

Status

record(sample_rate=None, length=None, buffer_size=None, callback=None, configure=False, start=False)[source]

Starts a data recording.

sample_ratefloat, optional

The sampling rate in Hz.

lengthfloat, optional

The recording length in seconds.

buffer_sizeint or float, optional

The buffer size.

configurebool, optional

If True, then the instrument is configured (default False).

startbool, optional

If True, then the recording is started (default False).

AnalogRecorder

The recorder instance.

Return type

AnalogRecorder

property record_length: float

Gets or sets the record length in seconds.

Return type

float

property record_status: Tuple[int, int, int]

Gets information about the recording process: Returns (available_samples, lost_samples, corrupted_samples)

Before calling this function, call the ‘read_status()’ function to read the data from the device.

Return type

Tuple[int, int, int]

property remaining_samples: int

Gets the number of samples left in the acquisition.

Before calling this function, call the ‘read_status()’ function to read the data from the device.

Return type

int

reset()[source]

Resets and configures all instrument parameters to default values.

Return type

None

scan_screen(sample_rate=None, buffer_size=None, configure=False, start=False)[source]

Starts a scan-screen data acquisition.

sample_ratefloat, optional

The sampling rate in Hz.

buffer_sizeint or float, optional

The buffer size.

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

scan_shift(sample_rate=None, buffer_size=None, configure=False, start=False)[source]

Starts a scan-shift data acquisition.

sample_ratefloat, optional

The sampling rate in Hz.

buffer_sizeint or float, optional

The buffer size.

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_acquisition(mode=None, sample_rate=None, buffer_size=None, record_length=None, configure=False, start=False)[source]

Sets up a new data acquisition.

modestr or AcquisitionMode, optional

The sampling mode. Can be ‘single’, ‘scan-shift’, ‘scan-screen’, or ‘record’.

sample_ratefloat, optional

The sampling rate in Hz.

buffer_sizeint or float, optional

The buffer size.

record_lengthfloat, optional

The record length in seconds.

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_channel(channel, range=None, offset=None, coupling=None, bandwidth=None, attenuation=None, impedance=None, filter=None, enabled=True)[source]

Sets up a channel for data acquisition.

channelint

The channel to setup.

rangefloat, optional

The channel range in Volts.

offsetfloat, optional

The channel offset in Volts.

couplingstr or AnalogInputCoupling, optional

The channel coupling. Can be ‘dc’ or ‘ac’.

bandwidthfloat, optional

The channel bandwidth in Hz.

attenuationfloat, optional

The channel attenuation.

impedancefloat, optional

The channel impedance in Ohms.

filterstr or FilterMode, optional

The channel acquisition filter. Can be ‘decimate’, ‘average’, or ‘min-max’.

enabledbool, optional

If True, then the channel is enabled (default True).

Return type

None

setup_edge_trigger(channel, slope=None, level=None, hysteresis=None, position=None, hold_off=None, mode=None)[source]

Trigger upon a certain voltage level in the positive or negative slope of the waveform.

channelint

The source channel used for triggering.

slopestr or TriggerSlope, optional

The trigger slope. Can be ‘rising’, ‘falling’, or ‘either’.

levelfloat, optional

The trigger level in Volts.

hysteresisfloat, optional

The trigger hysteresis in Volts.

positionfloat, optional

The horizontal trigger position in seconds.

hold_offfloat, optional

The trigger hold-off time in seconds.

modestr, optional

The trigger mode. Can be ‘normal’ or ‘auto’.

Return type

None

setup_pulse_trigger(channel, condition=None, length_condition=None, length=None, level=None, hysteresis=None, position=None, hold_off=None, mode=None)[source]

Trigger upon a positive or negative pulse width when measured at a certain voltage level.

channelint

The source channel used for triggering.

conditionstr, optional

The trigger condition. Can be ‘positive’ or ‘negative’.

length_conditionstr, optional

The trigger length condition. Can be ‘less’, ‘timeout’, or ‘more’.

lengthfloat, optional

The pulse length in seconds.

levelfloat, optional

The trigger level in Volts.

hysteresisfloat, optional

The trigger hysteresis in Volts.

positionfloat, optional

The horizontal trigger position in seconds.

hold_offfloat, optional

The trigger hold-off time in seconds.

modestr, optional

The trigger mode. Can be ‘normal’ or ‘auto’.

Return type

None

setup_transition_trigger(channel, condition=None, length_condition=None, length=None, level=None, hysteresis=None, position=None, hold_off=None, mode=None)[source]

Sets up a transition trigger.

channelint

The source channel used for triggering.

conditionstr, optional

The trigger condition. Can be ‘rising’, ‘falling’, or ‘either’.

length_conditionstr, optional

The trigger length condition. Can be ‘less’, ‘timeout’, or ‘more’.

lengthfloat, optional

The transition length in seconds.

levelfloat, optional

The trigger level in Volts.

hysteresisfloat, optional

The trigger hysteresis in Volts.

positionfloat, optional

The horizontal trigger position in seconds.

hold_offfloat, optional

The trigger hold-off time in seconds.

modestr, optional

The trigger mode. Can be ‘normal’ or ‘auto’.

Return type

None

setup_window_trigger(channel, condition=None, length=None, level=None, hysteresis=None, position=None, hold_off=None, mode=None)[source]

Trigger upon a signal entering or exiting a window at certain voltage thresholds.

channelint

The source channel used for triggering.

conditionstr, optional

The trigger condition. Can be ‘entering’ or ‘exiting’.

lengthfloat, optional

The window length in seconds.

levelfloat, optional

The trigger level in Volts.

hysteresisfloat, optional

The trigger hysteresis in Volts.

positionfloat, optional

The horizontal trigger position in seconds.

hold_offfloat, optional

The trigger hold-off time in seconds.

modestr, optional

The trigger mode. Can be ‘normal’ or ‘auto’.

Return type

None

single(sample_rate=None, buffer_size=None, continuous=True, configure=False, start=False)[source]

Starts a single data acquisition.

sample_ratefloat, optional

The sampling rate in Hz.

buffer_sizeint or float, optional

The buffer size.

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).

Return type

None

property time: Tuple[int, int, int]

Gets instrument trigger time information.

Before calling this function, call the ‘read_status()’ function to read the data from the device.

Return type

Tuple[int, int, int]

property timeout_max: float

Gets the maximum timeout value.

Return type

float

property trigger: AnalogInputTrigger

Gets the trigger unit.

Return type

AnalogInputTrigger

property valid_samples: int

Gets the number of valid/acquired data samples.

Before calling this function, call the ‘read_status()’ function to read the data from the device.

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.

Before calling this function, call the ‘read_status()’ function to read the data from the device.

Return type

int