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

Modules

 Combined instrument
 
 Events
 

Functions

uint32_t LstGetCount (void)
 Get number of devices in list.
 
bool8_t LstGetDeviceCanOpen (uint32_t dwIdKind, uint32_t dwId, uint32_t dwDeviceType)
 Check whether the instrument can be opened.
 
uint32_t LstGetDeviceProductId (uint32_t dwIdKind, uint32_t dwId)
 Get the instrument's product id.
 
uint32_t LstGetDeviceVendorId (uint32_t dwIdKind, uint32_t dwId)
 Get the instrument's vendor id.
 
uint32_t LstGetDeviceName (uint32_t dwIdKind, uint32_t dwId, char *pBuffer, uint32_t dwBufferLength)
 Get the instrument's name.
 
uint32_t LstGetDeviceNameShort (uint32_t dwIdKind, uint32_t dwId, char *pBuffer, uint32_t dwBufferLength)
 Get the instrument's short name.
 
uint32_t LstDevGetNameShortest (uint32_t dwIdKind, uint32_t dwId, char *pBuffer, uint32_t dwBufferLength)
 Get the instrument's short name wihout model postfix.
 
TpVersion_t LstDevGetDriverVersion (uint32_t dwIdKind, uint32_t dwId)
 Get version number of the driver.
 
TpVersion_t LstDevGetRecommendedDriverVersion (uint32_t dwIdKind, uint32_t dwId)
 Get recommended version number of the driver.
 
TpVersion_t LstDevGetFirmwareVersion (uint32_t dwIdKind, uint32_t dwId)
 Get version number of the firmware.
 
TpDate_t LstDevGetCalibrationDate (uint32_t dwIdKind, uint32_t dwId)
 Get the calibration date of the instrument.
 
uint32_t LstGetDeviceSerialNumber (uint32_t dwIdKind, uint32_t dwId)
 Get the instruments serial number.
 
uint32_t LstGetDeviceTypes (uint32_t dwIdKind, uint32_t dwId)
 Get the instrument's device types.
 
TpDeviceHandle_t LstOpenDevice (uint32_t dwIdKind, uint32_t dwId, uint32_t dwDeviceType)
 Get handle to device, for each device the handle is only assigned once.
 
TpDeviceHandle_t LstOpenOscilloscope (uint32_t dwIdKind, uint32_t dwId)
 Get handle to oscilloscope, for each oscilloscope the handle is only assigned once.
 
TpDeviceHandle_t LstOpenGenerator (uint32_t dwIdKind, uint32_t dwId)
 Get handle to generator, for each generator the handle is only assigned once.
 
TpDeviceHandle_t LstOpenI2CHost (uint32_t dwIdKind, uint32_t dwId)
 Get handle to I2C host, for each I2C host the handle is only assigned once.
 
uint32_t LstCreateCombinedDevice (TpDeviceHandle_t *pDeviceHandles, uint32_t dwCount)
 Create a combined instrument.
 
TpDeviceHandle_t LstCreateAndOpenCombinedDevice (TpDeviceHandle_t *pDeviceHandles, uint32_t dwCount)
 Create a combined instrument and get a handle.
 
void LstRemoveDevice (uint32_t dwSerialNumber)
 Remove a instrument from the device list so it can be used by other applications.
 
void LstUpdate (uint32_t dwDeviceIdMask)
 Search for new instruments.
 

Detailed Description

Function Documentation

uint32_t LstGetCount ( void  )

Get number of devices in list.

Returns
Number of devices in list.
Since
0.4.0
bool8_t LstGetDeviceCanOpen ( uint32_t  dwIdKind,
uint32_t  dwId,
uint32_t  dwDeviceType 
)

Check whether the instrument can be opened.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
dwDeviceTypeA device type.
Returns
BOOL8_TRUE if true or BOOL8_FALSE if false.
Since
0.4.0
uint32_t LstGetDeviceProductId ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the instrument's product id.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instrument's product id.
Since
0.4.0
uint32_t LstGetDeviceVendorId ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the instrument's vendor id.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instrument's vendor id.
Since
0.4.0
uint32_t LstGetDeviceName ( uint32_t  dwIdKind,
uint32_t  dwId,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's name.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
pBufferPointer to buffer to write to.
dwBufferLengthLength of the buffer.
Returns
Name length excluding excluding terminating zero.
See Also
LstGetDeviceNameShort
LstDevGetNameShortest
Example
uint32_t dwLength = LstGetDeviceName( dwIdKind , dwId , NULL , 0 ) + 1; // Add one for the terminating zero
char* sName = malloc( sizeof( char ) * dwLength );
dwLength = LstGetDeviceName( dwIdKind , dwId , sName , dwLength );
printf( "LstGetDeviceName = %s\n" , sName );
free( sName );
Since
0.4.0
uint32_t LstGetDeviceNameShort ( uint32_t  dwIdKind,
uint32_t  dwId,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's short name.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
pBufferPointer to buffer to write to.
dwBufferLengthLength of the buffer.
Returns
Short name length excluding terminating zero.
See Also
LstGetDeviceName
LstDevGetNameShortest
Example
uint32_t dwLength = LstGetDeviceNameShort( dwIdKind , dwId , NULL , 0 ) + 1; // Add one for the terminating zero
char* sNameShort = malloc( sizeof( char ) * dwLength );
dwLength = LstGetDeviceNameShort( dwIdKind , dwId , sNameShort , dwLength );
printf( "LstGetDeviceNameShort = %s\n" , sNameShort );
free( sNameShort );
Since
0.4.0
uint32_t LstDevGetNameShortest ( uint32_t  dwIdKind,
uint32_t  dwId,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's short name wihout model postfix.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
pBufferPointer to buffer to write to.
dwBufferLengthLength of the buffer.
Returns
Short name length excluding terminating zero.
See Also
LstGetDeviceName
LstGetDeviceNameShort
Example
uint32_t dwLength = LstDevGetNameShortest( dwIdKind , dwId , NULL , 0 ) + 1; // Add one for the terminating zero
char* sNameShortest = malloc( sizeof( char ) * dwLength );
dwLength = LstDevGetNameShortest( dwIdKind , dwId , sNameShortest , dwLength );
printf( "LstDevGetNameShortest = %s\n" , sNameShortest );
free( sNameShortest );
Since
0.4.4
TpVersion_t LstDevGetDriverVersion ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get version number of the driver.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments driver version, or zero if no driver version is available.
Since
0.4.1
TpVersion_t LstDevGetRecommendedDriverVersion ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get recommended version number of the driver.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments driver version, or zero if no driver version is available.
Since
0.4.3
TpVersion_t LstDevGetFirmwareVersion ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get version number of the firmware.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments firmware version, or zero if no firmware version is available.
Since
0.4.1
TpDate_t LstDevGetCalibrationDate ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the calibration date of the instrument.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments calibration date, or zero if no calibration date is available.
Since
0.4.1
uint32_t LstGetDeviceSerialNumber ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the instruments serial number.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments serial number.
Since
0.4.0
uint32_t LstGetDeviceTypes ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the instrument's device types.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
OR-ed mask of device types.
Example
uint32_t dwDeviceTypes = LstGetDeviceTypes( dwIdKind , dwId );
// Test all device types:
if( dwDeviceTypes & DEVICETYPE_OSCILLOSCOPE )
printf( "DEVICETYPE_OSCILLOSCOPE\n" );
if( dwDeviceTypes & DEVICETYPE_GENERATOR )
printf( "DEVICETYPE_GENERATOR\n" );
if( dwDeviceTypes & DEVICETYPE_I2CHOST )
printf( "DEVICETYPE_I2CHOST\n" );
Since
0.4.0
TpDeviceHandle_t LstOpenDevice ( uint32_t  dwIdKind,
uint32_t  dwId,
uint32_t  dwDeviceType 
)

Get handle to device, for each device the handle is only assigned once.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
dwDeviceTypeA device type.
Returns
A device handle, or TPDEVICEHANDLE_INVALID on error.
See Also
LstOpenOscilloscope
LstOpenGenerator
LstOpenI2CHost
DevClose
Since
0.4.0
TpDeviceHandle_t LstOpenOscilloscope ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get handle to oscilloscope, for each oscilloscope the handle is only assigned once.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
A device handle, or TPDEVICEHANDLE_INVALID on error.
See Also
LstOpenDevice
LstOpenGenerator
LstOpenI2CHost
DevClose
Since
0.4.0
TpDeviceHandle_t LstOpenGenerator ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get handle to generator, for each generator the handle is only assigned once.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
A device handle, or TPDEVICEHANDLE_INVALID on error.
See Also
LstOpenDevice
LstOpenOscilloscope
LstOpenI2CHost
DevClose
Since
0.4.0
TpDeviceHandle_t LstOpenI2CHost ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get handle to I2C host, for each I2C host the handle is only assigned once.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
A device handle, or TPDEVICEHANDLE_INVALID on error.
See Also
LstOpenDevice
LstOpenOscilloscope
DevClose
Since
0.4.0
uint32_t LstCreateCombinedDevice ( TpDeviceHandle_t pDeviceHandles,
uint32_t  dwCount 
)

Create a combined instrument.

Parameters
pDeviceHandlesDevice handles to combine.
dwCountNumber of device handles.
Returns
Combined device serial number, or zero on error.
See Also
LstCreateAndOpenCombinedDevice
Since
0.4.4
TpDeviceHandle_t LstCreateAndOpenCombinedDevice ( TpDeviceHandle_t pDeviceHandles,
uint32_t  dwCount 
)

Create a combined instrument and get a handle.

Parameters
pDeviceHandlesDevice handles to combine.
dwCountNumber of device handles.
Returns
A device handle, or TPDEVICEHANDLE_INVALID on error.
See Also
LstCreateCombinedDevice
Since
0.4.4
void LstRemoveDevice ( uint32_t  dwSerialNumber)

Remove a instrument from the device list so it can be used by other applications.

Parameters
dwSerialNumberInstruments serial number.
Since
0.4.0
void LstUpdate ( uint32_t  dwDeviceIdMask)

Search for new instruments.

Parameters
dwDeviceIdMaskA OR-ed mask of Device ID's.
Examples
LstUpdate( IDM_ALL ); // Search for all instruments
LstUpdate( ID_HS5 ); // Search for Handyscope HS5's only
Since
0.4.0