ADU  Series - USB Data Acquisition Interface SDK 

OpenAduDeviceByProductId

This functions searches for any ADU device attached to the computer that matches the product id. The function opens the first ADU device that matches and passes back a handle to it.

The handle value must be retained by the calling program and used with all subsequent ReadAduDevice, WriteAduDevice and CloseAduDevice function calls.

Note that "first" in this context does not necessarily reflect the order that the devices were plugged in. "First" means the first one encountered in the internal list maintained by the Windows operating system.

The product id of an ADU device is the numeric portion of the model number. Thus an ADU100 has a product id of 100, while an ADU200 has a product id of 100. (The USB specification requires product ids to be integer numbers.)

If more than 1 ADU device with the same product id is connected then use OpenAduDeviceBySerialNumber instead of OpenAduDeviceByProductId.

C Declaration:

void * __stdcall OpenAduDeviceByProductId(int iProductId,
unsigned long iTimeout);

Visual Basic Declaration:

Declare Function OpenAduDeviceByProductId Lib "AduHid.DLL" _
(ByVal iProductId As Long, _
ByVal iTimeout As Long) As Long

Arguments:

Argument Type Value Description
iProductId integer non 0 product id to search for
iTimeout unsigned long 0 timeouts disabled
other timeout processing enabled


Any non-zero iTimeout value will enable timeout handling. The actual timeout period is passed into the ReadAduDevice and WriteAduDevice function calls.

Return Codes:

Value Description
INVALID_HANDLE_VALUE device was not opened
0 device was not opened
other Handle to the ADU device