LibTiePie  0.9.12
Library for interfacing TiePie engineering instruments

Description

Functions to control the clock source of the oscilloscope.

Oscilloscopes can support multiple clock sources, use ScpGetClockSources() to determine the available clock sources for an oscilloscope.

When an oscilloscope supports selecting an external clock source, refer to the instrument manual for the location of the external clock input and the specifications of the required external clock signal.

Depending on the instrument, an external clock input can support multiple input frequencies. Use ScpGetClockSourceFrequencies() to determine which frequencies are supported.

By default the clock source is set to: Internal (CS_INTERNAL).

Functions

uint32_t ScpGetClockSources (LibTiePieHandle_t hDevice)
 Get the supported clock sources of the specified oscilloscope. More...
 
uint32_t ScpGetClockSource (LibTiePieHandle_t hDevice)
 Get the currently selected clock source of the specified oscilloscope. More...
 
uint32_t ScpSetClockSource (LibTiePieHandle_t hDevice, uint32_t dwClockSource)
 Set the clock source of the specified oscilloscope. More...
 
uint32_t ScpGetClockSourceFrequencies (LibTiePieHandle_t hDevice, double *pList, uint32_t dwLength)
 Get an array with the supported clock source frequencies of the specified oscilloscope. More...
 
double ScpGetClockSourceFrequency (LibTiePieHandle_t hDevice)
 Get the current clock source frequency of the specified oscilloscope. More...
 
double ScpSetClockSourceFrequency (LibTiePieHandle_t hDevice, double dClockSourceFrequency)
 Set the clock source frequency of the specified oscilloscope. More...
 

Function Documentation

uint32_t ScpGetClockSources ( LibTiePieHandle_t  hDevice)

Get the supported clock sources of the specified oscilloscope.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
Returns
The supported clock sources, a set of OR-ed CS_* values, or 0 when unsuccessful.
Status values
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
ScpGetClockSource
ScpSetClockSource
ScpGetClockSourceFrequencies
ScpGetClockSourceFrequency
ScpSetClockSourceFrequency
Since
0.4.0
uint32_t ScpGetClockSource ( LibTiePieHandle_t  hDevice)

Get the currently selected clock source of the specified oscilloscope.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
Returns
The current clock source, a CS_* value, or 0 when unsuccessful.
Status values
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
ScpGetClockSources
ScpSetClockSource
ScpGetClockSourceFrequencies
ScpGetClockSourceFrequency
ScpSetClockSourceFrequency
Since
0.4.0
uint32_t ScpSetClockSource ( LibTiePieHandle_t  hDevice,
uint32_t  dwClockSource 
)

Set the clock source of the specified oscilloscope.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]dwClockSourceThe requested clock source, a CS_* value.
Returns
The actually set clock source, a CS_* value, or 0 when unsuccessful.
Status values
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
ScpGetClockSources
ScpGetClockSource
ScpGetClockSourceFrequencies
ScpGetClockSourceFrequency
ScpSetClockSourceFrequency
Since
0.4.0
uint32_t ScpGetClockSourceFrequencies ( LibTiePieHandle_t  hDevice,
double *  pList,
uint32_t  dwLength 
)

Get an array with the supported clock source frequencies of the specified oscilloscope.

The caller must assure that enough memory is allocated. This function is only available when the clock source is set to CS_EXTERNAL.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[out]pListA pointer to an array for the clock source frequencies, or NULL.
[in]dwLengthThe number of elements in the array.
Returns
Total number of supported clock source frequencies, or 0 when unsuccessful.
Status values
NOT_SUPPORTED The oscilloscope does not support external clock or the clock source is not set to CS_EXTERNAL.
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.
Example
uint32_t dwLength = ScpGetClockSourceFrequencies( hDevice , NULL , 0 );
double* pFrequencies = malloc( sizeof( double ) * dwLength );
dwLength = ScpGetClockSourceFrequencies( hDevice , pFrequencies , dwLength );
for( i = 0 ; i < dwLength ; i++ )
{
printf( "%f\n" , pFrequencies[ i ] );
}
free( pFrequencies );
See also
ScpGetClockSources
ScpGetClockSource
ScpSetClockSource
ScpGetClockSourceFrequency
ScpSetClockSourceFrequency
Since
0.6
double ScpGetClockSourceFrequency ( LibTiePieHandle_t  hDevice)

Get the current clock source frequency of the specified oscilloscope.

This function is only available when the clock source is set to CS_EXTERNAL.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
Returns
The current clock source frequency in Hz, or 0 when unsuccessful.
Status values
NOT_SUPPORTED The oscilloscope does not support external clock or the clock source is not set to CS_EXTERNAL.
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
ScpGetClockSources
ScpGetClockSource
ScpSetClockSource
ScpGetClockSourceFrequencies
ScpSetClockSourceFrequency
Since
0.6
double ScpSetClockSourceFrequency ( LibTiePieHandle_t  hDevice,
double  dClockSourceFrequency 
)

Set the clock source frequency of the specified oscilloscope.

This function is only available when the clock source is set to CS_EXTERNAL.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]dClockSourceFrequencyThe required clock source frequency in Hz.
Returns
The actually set clock source frequency in Hz, or 0 when unsuccessful.
Status values
VALUE_CLIPPED The requested clock source frequency is outside the valid range and clipped to the closest limit.
VALUE_MODIFIED The requested clock source frequency is within the valid range but not available. The closest valid value is set.
INVALID_VALUE The requested value is invalid.
NOT_SUPPORTED The oscilloscope does not support external clock or the clock source is not set to CS_EXTERNAL.
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
ScpGetClockSources
ScpGetClockSource
ScpSetClockSource
ScpGetClockSourceFrequencies
ScpGetClockSourceFrequency
Since
0.6