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

Modules

 Events
 

Functions

uint32_t LstGetCount ()
 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 instruments product id.
 
uint32_t LstGetDeviceVendorId (uint32_t dwIdKind, uint32_t dwId)
 Get the instruments vendor id.
 
uint32_t LstGetDeviceName (uint32_t dwIdKind, uint32_t dwId, char *pBuffer, uint32_t dwBufferLength)
 Get the instruments name.
 
uint32_t LstGetDeviceNameShort (uint32_t dwIdKind, uint32_t dwId, char *pBuffer, uint32_t dwBufferLength)
 Get the instruments short name.
 
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 instruments 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

uint32_t LstGetCount ( )

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 instruments name.

Example:

uint32_t dwLength = LstGetDeviceName( dwIdKind , dwId , NULL , 0 ) + 1; // Add one for the terminating zero
char sNameShort[ dwLength ];
dwLength = LstGetDeviceName( dwIdKind , dwId , sNameShort , dwLength );
printf( "LstGetDeviceName = %s\n" , 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
uint32_t LstGetDeviceNameShort ( uint32_t  dwIdKind,
uint32_t  dwId,
char *  pBuffer,
uint32_t  dwBufferLength 
)

Get the instruments short name.

Example:

uint32_t dwLength = LstGetDeviceNameShort( dwIdKind , dwId , NULL , 0 ) + 1; // Add one for the terminating zero
char sNameShort[ dwLength ];
dwLength = LstGetDeviceNameShort( dwIdKind , dwId , sNameShort , dwLength );
printf( "LstGetDeviceNameShort = %s\n" , 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
uint32_t LstGetDeviceProductId ( uint32_t  dwIdKind,
uint32_t  dwId 
)

Get the instruments product id.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments 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 instruments 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 instruments vendor id.

Parameters
dwIdKindAn id kind.
dwIdDevice index, Device ID or serial number as specified by dwIdKind.
Returns
Instruments 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.