LibTiePie  0.4.2
Library for interfacing TiePie engineering instruments
 All Files Functions Typedefs 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.
 
TpVersion_t LstDevGetDriverVersion (uint32_t dwIdKind, uint32_t dwId)
 Get 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.
 
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

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.
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.
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.
uint32_t LstGetCount ( void  )

Get number of devices in list.

Returns
Number of devices in list.
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.
uint32_t LstGetDeviceName ( uint32_t  dwIdKind,
uint32_t  dwId,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's name.

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 );
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
uint32_t LstGetDeviceNameShort ( uint32_t  dwIdKind,
uint32_t  dwId,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instrument's short name.

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 );
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
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.
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.
uint32_t LstGetDeviceTypes ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the instrument's 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" );
Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
OR-ed mask of device types.
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.
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
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
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
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
void LstRemoveDevice ( uint32_t  dwSerialNumber)

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

Parameters
dwSerialNumberInstruments serial number.
void LstUpdate ( uint32_t  dwDeviceIdMask)

Search for new instruments.

Example 1:

LstUpdate( IDM_ALL ); // Search for all instruments

Example 2:

LstUpdate( ID_HS5 ); // Search for Handyscope HS5's only
Parameters
dwDeviceIdMaskA OR-ed mask of Device ID's.