LibTiePie  0.9.14
Library for interfacing TiePie engineering instruments

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 ScpGetValidPreSampleCount() before collecting the data to determine the amount of valid pre samples. To ensure the pre samples buffer will be completely filled, set the trigger hold off to TH_ALLPRESAMPLES.

Functions

double ScpGetPreSampleRatio (LibTiePieHandle_t hDevice)
 Get the current pre sample ratio of a specified oscilloscope. More...
 
double ScpSetPreSampleRatio (LibTiePieHandle_t hDevice, double dPreSampleRatio)
 Set the pre sample ratio of a specified oscilloscope. More...
 

Function Documentation

double ScpGetPreSampleRatio ( LibTiePieHandle_t  hDevice)

Get the current pre sample ratio of a specified oscilloscope.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
Returns
The currently selected pre sample ratio, a value between 0 and 1.
Status values
NOT_SUPPORTED The indicated oscilloscope does not support pre samples with the current settings.
INVALID_HANDLE The handle is not a valid oscilloscope handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
ScpSetPreSampleRatio
Since
0.4.0
double ScpSetPreSampleRatio ( LibTiePieHandle_t  hDevice,
double  dPreSampleRatio 
)

Set the pre sample ratio of a specified oscilloscope.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]dPreSampleRatioThe 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
NOT_SUPPORTED The indicated oscilloscope does not support pre samples with the current settings.
INVALID_VALUE The requested value is invalid.
INVALID_HANDLE The handle is not a valid oscilloscope handle.
OBJECT_GONE The object indicated by the handle is no longer available.
LIBRARY_NOT_INITIALIZEDThe library is not initialized, see LibInit().
SUCCESS The function executed successfully.
See also
ScpGetPreSampleRatio
ScpGetValidPreSampleCount
Hold off
Since
0.4.0