LibTiePie  0.4.4
Library for interfacing TiePie engineering instruments
 All Files Functions Typedefs Macros Groups Pages
Range

Functions

bool8_t ScpChGetAutoRanging (TpDeviceHandle_t hDevice, uint16_t wCh)
 Check whether auto ranging is enabled.
 
bool8_t ScpChSetAutoRanging (TpDeviceHandle_t hDevice, uint16_t wCh, bool8_t bEnable)
 Set auto ranging.
 
uint32_t ScpChGetRanges (TpDeviceHandle_t hDevice, uint16_t wCh, double *pList, uint32_t dwLength)
 Get supported ranges for current coupling.
 
double ScpChGetRange (TpDeviceHandle_t hDevice, uint16_t wCh)
 Get range.
 
double ScpChSetRange (TpDeviceHandle_t hDevice, uint16_t wCh, double dRange)
 Set range.
 

Detailed Description

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

Function Documentation

bool8_t ScpChGetAutoRanging ( TpDeviceHandle_t  hDevice,
uint16_t  wCh 
)

Check whether auto ranging is enabled.

Parameters
hDeviceA device handle.
wChChannel number, 0 to ScpGetChannelCount() - 1.
Returns
BOOL8_TRUE if enabled, BOOL8_FALSE if disabled.
Since
0.4.0
bool8_t ScpChSetAutoRanging ( TpDeviceHandle_t  hDevice,
uint16_t  wCh,
bool8_t  bEnable 
)

Set auto ranging.

Parameters
hDeviceA device handle.
wChChannel number, 0 to ScpGetChannelCount() - 1.
bEnableBOOL8_TRUE to enable or BOOL8_FALSE to disable.
Returns
BOOL8_TRUE if enabled, BOOL8_FALSE if disabled.
Since
0.4.0
uint32_t ScpChGetRanges ( TpDeviceHandle_t  hDevice,
uint16_t  wCh,
double *  pList,
uint32_t  dwLength 
)

Get supported ranges for current coupling.

Parameters
hDeviceA device handle.
wChChannel number, 0 to ScpGetChannelCount() - 1.
pListPointer to array.
dwLengthNumber of elements in array.
Returns
Total number of ranges.
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 );
Since
0.4.0
double ScpChGetRange ( TpDeviceHandle_t  hDevice,
uint16_t  wCh 
)

Get range.

Parameters
hDeviceA device handle.
wChChannel number, 0 to ScpGetChannelCount() - 1.
Returns
Range.
Since
0.4.0
double ScpChSetRange ( TpDeviceHandle_t  hDevice,
uint16_t  wCh,
double  dRange 
)

Set range.

Parameters
hDeviceA device handle.
wChChannel number, 0 to ScpGetChannelCount() - 1.
dRangeMaximum value that must fit within range.
Returns
Range.
Remarks
Setting the range will disable auto ranging if enabled.
Example
double dRange = 10;
dRange = ScpChSetRange( hDevice , wCh , dRange );
printf( "ScpChSetRange = %f" , dRange );
Since
0.4.0