LibTiePie  0.4.3
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.
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.
uint32_t ScpChGetRanges ( TpDeviceHandle_t  hDevice,
uint16_t  wCh,
double *  pList,
uint32_t  dwLength 
)

Get supported ranges for current coupling.

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

Get range.

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

Set range.

Example:

double dRange = 10;
dRange = ScpChSetRange( hDevice , wCh , dRange );
printf( "ScpChSetRange = %f" , dRange );
Note
Setting the range doesn't disable auto ranging.
Parameters
hDeviceA device handle.
wChChannel number, 0 to ScpGetChannelCount() - 1.
dRangeMaximum value that must fit within range.
Returns
Range.