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

Functions

TpVersion_t DevGetDriverVersion (TpDeviceHandle_t hDevice)
 Get version number of the driver.
 
TpVersion_t DevGetFirmwareVersion (TpDeviceHandle_t hDevice)
 Get version number of the firmware.
 
TpDate_t DevGetCalibrationDate (TpDeviceHandle_t hDevice)
 Get the calibration date of the instrument.
 
uint32_t DevGetSerialNumber (TpDeviceHandle_t hDevice)
 Get the instrument's serial number.
 
uint32_t DevGetProductId (TpDeviceHandle_t hDevice)
 Get the instrument's product id.
 
uint32_t DevGetVendorId (TpDeviceHandle_t hDevice)
 Get the instrument's vendor id.
 
uint32_t DevGetType (TpDeviceHandle_t hDevice)
 Get device type.
 
uint32_t DevGetName (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
 Get the instruments name.
 
uint32_t DevGetNameShort (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
 Get the instrument's short name.
 
uint32_t DevGetNameShortest (TpDeviceHandle_t hDevice, char *pBuffer, uint32_t dwBufferLength)
 Get the instrument's short name without model prefix.
 

Detailed Description

Function Documentation

TpVersion_t DevGetDriverVersion ( TpDeviceHandle_t  hDevice)

Get version number of the driver.

Parameters
hDeviceA device handle.
Returns
Driver version number, or zero if no version number is available.
Example
TpVersion_t Version = DevGetDriverVersion( hDevice );
uint16_t wMajor = TPVERSION_MAJOR( Version );
uint16_t wMinor = TPVERSION_MINOR( Version );
uint16_t wRelease = TPVERSION_RELEASE( Version );
uint16_t wBuild = TPVERSION_BUILD( Version );
printf( "DevGetDriverVersion = %u.%u.%u.%u\n" , wMajor , wMinor , wRelease , wBuild );
Since
0.4.0
TpVersion_t DevGetFirmwareVersion ( TpDeviceHandle_t  hDevice)

Get version number of the firmware.

Parameters
hDeviceA device handle.
Returns
Firmware version number, or zero if no version number is available.
Example
TpVersion_t Version = DevGetFirmwareVersion( hDevice );
uint16_t wMajor = TPVERSION_MAJOR( Version );
uint16_t wMinor = TPVERSION_MINOR( Version );
uint16_t wRelease = TPVERSION_RELEASE( Version );
uint16_t wBuild = TPVERSION_BUILD( Version );
printf( "DevGetFirmwareVersion = %u.%u.%u.%u\n" , wMajor , wMinor , wRelease , wBuild );
Since
0.4.0
TpDate_t DevGetCalibrationDate ( TpDeviceHandle_t  hDevice)

Get the calibration date of the instrument.

Parameters
hDeviceA device handle.
Returns
Instruments calibration date, or zero if no calibration date is available.
Example
TpDate_t Date = DevGetCalibrationDate( hDevice );
uint16_t wYear = TPDATE_YEAR( Date );
uint8_t byMonth = TPDATE_MONTH( Date );
uint8_t byDay = TPDATE_DAY( Date );
printf( "DevGetCalibrationDate = %u-%u-%u\n" , wYear , byMonth , byDay );
Since
0.4.0
uint32_t DevGetSerialNumber ( TpDeviceHandle_t  hDevice)

Get the instrument's serial number.

Parameters
hDeviceA device handle.
Returns
Instrument's serial number.
Since
0.4.0
uint32_t DevGetProductId ( TpDeviceHandle_t  hDevice)

Get the instrument's product id.

Parameters
hDeviceA device handle.
Returns
Instrument's product id.
Since
0.4.0
uint32_t DevGetVendorId ( TpDeviceHandle_t  hDevice)

Get the instrument's vendor id.

Parameters
hDeviceA device handle.
Returns
Instrument's vendor id.
Since
0.4.0
uint32_t DevGetType ( TpDeviceHandle_t  hDevice)

Get device type.

Parameters
hDeviceA device handle.
Returns
Device type.
Since
0.4.0
uint32_t DevGetName ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instruments name.

Parameters
hDeviceA device handle.
pBufferPointer to buffer to write to.
dwBufferLengthLength of the buffer.
Returns
Name length excluding excluding terminating zero.
See Also
DevGetNameShort
DevGetNameShortest
Example
uint32_t dwLength = DevGetName( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char* sName = malloc( sizeof( char ) * dwLength );
dwLength = DevGetName( hDevice , sName , dwLength );
printf( "DevGetName = %s\n" , sName );
free( sName );
Since
0.4.0
uint32_t DevGetNameShort ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's short name.

Parameters
hDeviceA device handle.
pBufferPointer to buffer to write to.
dwBufferLengthLength of the buffer.
Returns
Short name length excluding excluding terminating zero.
See Also
DevGetName
DevGetNameShortest
Example
uint32_t dwLength = DevGetNameShort( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char* sNameShort = malloc( sizeof( char ) * dwLength );
dwLength = DevGetNameShort( hDevice , sNameShort , dwLength );
printf( "DevGetNameShort = %s\n" , sNameShort );
free( sNameShort );
Since
0.4.0
uint32_t DevGetNameShortest ( TpDeviceHandle_t  hDevice,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's short name without model prefix.

Parameters
hDeviceA device handle.
pBufferPointer to buffer to write to.
dwBufferLengthLength of the buffer.
Returns
Short name length excluding excluding terminating zero.
See Also
DevGetName
DevGetNameShort
Since
0.4.4
Example
uint32_t dwLength = DevGetNameShortest( hDevice , NULL , 0 ) + 1; // Add one for the terminating zero
char* sNameShortest = malloc( sizeof( char ) * dwLength );
dwLength = DevGetNameShortest( hDevice , sNameShortest , dwLength );
printf( "DevGetNameShortest = %s\n" , sNameShortest );
free( sNameShortest );
Since
0.4.0