libtiepie-hw  1.2.1

Functions to control pre samples. More...

Collaboration diagram for Pre samples:

Functions

TIEPIE_HW_API double tiepie_hw_oscilloscope_get_pre_sample_ratio (tiepie_hw_handle handle)
 Get the current pre sample ratio of a specified oscilloscope. More...
 
TIEPIE_HW_API double tiepie_hw_oscilloscope_set_pre_sample_ratio (tiepie_hw_handle handle, double value)
 Set the pre sample ratio of a specified oscilloscope. More...
 

Detailed Description

Functions to control pre samples.

When pre samples are selected (pre sample ratio > 0), the trigger point is located at position (pre sample ratio * record length), dividing the record in pre samples and post samples. This way it is possible to "look back in time" since the pre samples were captured before the trigger moment.

Pre sample ratio is set as a number between 0 and 1, representing the percentage of the total record length:

By default the pre sample ratio is: 0 (no pre samples).

The pre sample buffer is not completely filled by default. When a trigger occurs before the pre sample buffer is filled, part of the pre samples will be invalid. Use tiepie_hw_oscilloscope_get_valid_pre_sample_count() before collecting the data to determine the amount of valid pre samples. To ensure the pre samples buffer will be completely filled, set Presamples valid to true.

Function Documentation

◆ tiepie_hw_oscilloscope_get_pre_sample_ratio()

TIEPIE_HW_API double tiepie_hw_oscilloscope_get_pre_sample_ratio ( tiepie_hw_handle  handle)

Get the current pre sample ratio of a specified oscilloscope.

Parameters
[in]handleA device handle identifying the oscilloscope.
Returns
The currently selected pre sample ratio, a value between 0 and 1.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated oscilloscope does not support pre samples with the current settings.
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_set_pre_sample_ratio
Since
1.0

◆ tiepie_hw_oscilloscope_set_pre_sample_ratio()

TIEPIE_HW_API double tiepie_hw_oscilloscope_set_pre_sample_ratio ( tiepie_hw_handle  handle,
double  value 
)

Set the pre sample ratio of a specified oscilloscope.

Parameters
[in]handleA device handle identifying the oscilloscope.
[in]valueThe required pre sample ratio, a number between 0 and 1.
Returns
The actually set pre sample ratio, a number between 0 and 1.
Status values
TIEPIE_HW_STATUS_NOT_SUPPORTED The indicated oscilloscope does not support pre samples with the current settings.
TIEPIE_HW_STATUS_INVALID_VALUE
TIEPIE_HW_STATUS_INVALID_HANDLE The handle is not a valid oscilloscope handle.
TIEPIE_HW_STATUS_OBJECT_GONE
TIEPIE_HW_STATUS_LIBRARY_NOT_INITIALIZED
TIEPIE_HW_STATUS_SUCCESS
See also
tiepie_hw_oscilloscope_get_pre_sample_ratio
tiepie_hw_oscilloscope_get_valid_pre_sample_count
Presamples valid
Since
1.0