dwfpy.digital_recorder.DigitalRecorder

class DigitalRecorder(module)[source]

Bases: object

Recorder for Digital Input data

Methods

process

Checks the instrument status and processes a chunk of data if available.

record

Starts the recording and processes all samples until the recording is complete.

stream

Starts the streaming.

Attributes

corrupted_samples

Gets the number of corrupted samples.

data_samples

Gets the acquired data samples.

lost_samples

Gets the number of lost samples.

noise_samples

Gets the acquired noise samples.

requested_samples

Gets the number of requested samples for recording.

status

Gets the last acquisition status.

total_samples

Gets the total number of acquired and lost samples.

property corrupted_samples: int

Gets the number of corrupted samples.

Return type

int

property data_samples: tuple

Gets the acquired data samples.

Return type

tuple

property lost_samples: int

Gets the number of lost samples.

Return type

int

property noise_samples: tuple

Gets the acquired noise samples.

Return type

tuple

process()[source]

Checks the instrument status and processes a chunk of data if available.

bool

If True, then if there is more data to process, and the function must be called again. If False, the recording is complete, and you must stop calling this function.

This function must be called repeatedly by the user to process the recording data. Failure to call this function in a timely manner will cause samples to get lost or corrupted.

Return type

bool

record(callback=None)[source]

Starts the recording and processes all samples until the recording is complete.

callbackfunction

A user-defined function that is called every time a data chunk is processed. Return True to continue recording, False to abort the recording.

This function blocks until the recording is complete.

Return type

None

property requested_samples: int

Gets the number of requested samples for recording.

Return type

int

property status: Status

Gets the last acquisition status.

Return type

Status

stream(callback)[source]

Starts the streaming.

callbackfunction

A user-defined function that is called every time a data chunk is processed. Return True to continue streaming, False to stop the streaming.

Return type

None

property total_samples: int

Gets the total number of acquired and lost samples.

Return type

int