LibTiePie  0.9.16
Library for interfacing TiePie engineering instruments

Description

Functions to control the input range of an oscilloscope channel.

An oscilloscope channel will have one or more different input ranges. The number of input ranges and which ranges are available depends on the selected input coupling. Use ScpChGetRanges() to determine how many and which ranges are available. Changing the input couping may change the selected input range.

An input channel supports auto ranging, where a suitable input range is selected based on the measured data of the last performed measurement with the channel. Manually setting a range will disable auto ranging.

When auto ranging of a channel is enabled and trigger level mode is set to TLM_ABSOLUTE, the input range will not auto range to a range that is smaller than the selected trigger level.

By default the highest available range is selected and auto ranging is enabled.

Functions

bool8_t ScpChGetAutoRanging (LibTiePieHandle_t hDevice, uint16_t wCh)
 Check whether auto ranging is enabled for a specified channel. More...
 
bool8_t ScpChSetAutoRanging (LibTiePieHandle_t hDevice, uint16_t wCh, bool8_t bEnable)
 Set auto ranging for a specified channel. More...
 
uint32_t ScpChGetRanges (LibTiePieHandle_t hDevice, uint16_t wCh, double *pList, uint32_t dwLength)
 Get the supported input ranges for a specified channel, with the currently selected coupling. More...
 
double ScpChGetRange (LibTiePieHandle_t hDevice, uint16_t wCh)
 Get the currently selected input range for a specified channel. More...
 
double ScpChSetRange (LibTiePieHandle_t hDevice, uint16_t wCh, double dRange)
 Set the input range for a specified channel. More...
 

Function Documentation

bool8_t ScpChGetAutoRanging ( LibTiePieHandle_t  hDevice,
uint16_t  wCh 
)

Check whether auto ranging is enabled for a specified channel.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]wChThe channel number identifying the channel, 0 to ScpGetChannelCount() - 1.
Returns
BOOL8_TRUE if enabled, BOOL8_FALSE if disabled.
Status values
INVALID_CHANNEL The requested channel number 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
ScpChSetAutoRanging
Since
0.4.0
bool8_t ScpChSetAutoRanging ( LibTiePieHandle_t  hDevice,
uint16_t  wCh,
bool8_t  bEnable 
)

Set auto ranging for a specified channel.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]wChThe channel number identifying the channel, 0 to ScpGetChannelCount() - 1.
[in]bEnableBOOL8_TRUE to enable or BOOL8_FALSE to disable.
Returns
BOOL8_TRUE if enabled, BOOL8_FALSE if disabled.
Status values
NOT_SUPPORTED With the current settings, auto ranging is not available.
INVALID_CHANNEL The requested channel number 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
ScpChGetAutoRanging
Since
0.4.0
uint32_t ScpChGetRanges ( LibTiePieHandle_t  hDevice,
uint16_t  wCh,
double *  pList,
uint32_t  dwLength 
)

Get the supported input ranges for a specified channel, with the currently selected coupling.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]wChThe channel number identifying the channel, 0 to ScpGetChannelCount() - 1.
[out]pListA pointer to an array for the input ranges.
[in]dwLengthThe number of elements in the array.
Returns
The total number of ranges.
Status values
UNSUCCESSFUL An error occurred during execution of the last called function.
INVALID_CHANNEL The requested channel number 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.
Example
uint32_t dwRangeCount = ScpChGetRanges( hDevice , wCh , NULL , 0 );
double* pRanges = malloc( sizeof( double ) * dwRangeCount );
dwRangeCount = ScpChGetRanges( hDevice , wCh , pRanges , dwRangeCount );
printf( "ScpChGetRanges (Ch%u):\n" , wCh + 1 );
for( i = 0 ; i < dwRangeCount ; i++ )
printf( "- %f\n" , pRanges[ i ] );
free( pRanges );
See also
ScpChGetRange
ScpChSetRange
Since
0.4.0
double ScpChGetRange ( LibTiePieHandle_t  hDevice,
uint16_t  wCh 
)

Get the currently selected input range for a specified channel.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]wChThe channel number identifying the channel, 0 to ScpGetChannelCount() - 1.
Returns
The currently selected input range.
Status values
INVALID_CHANNEL The requested channel number 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
ScpChGetRanges
ScpChSetRange
Since
0.4.0
double ScpChSetRange ( LibTiePieHandle_t  hDevice,
uint16_t  wCh,
double  dRange 
)

Set the input range for a specified channel.

When a non existing input range value is tried to be set, the closest available larger input range is selected.

Parameters
[in]hDeviceA device handle identifying the oscilloscope.
[in]wChThe channel number identifying the channel, 0 to ScpGetChannelCount() - 1.
[in]dRangeThe requested input range, or maximum absolute value that must fit within the range.
Returns
The actually selected input range.
Status values
VALUE_CLIPPED The requested input range is larger than the largest available range and clipped to that range.
VALUE_MODIFIED The requested input range is within the valid range but not available. The closest larger valid value is set.
INVALID_VALUE The requested input range is invalid.
INVALID_CHANNEL The requested channel number 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.
Remarks
Setting the range will disable auto ranging if enabled.
Changing the input range may affect the trigger level(s) if the trigger level mode is TLM_ABSOLUTE.
Example
double dRange = 10;
dRange = ScpChSetRange( hDevice , wCh , dRange );
printf( "ScpChSetRange = %f" , dRange );
See also
ScpChGetRanges
ScpChGetRange
Since
0.4.0