ADU  Series - USB Data Acquisition Interface SDK 

AduHid API Declarations for Visual Basic

Rem Copyright 2002 Ontrak Control Systems Incorporated
Rem By: John Homppi, Oct 28, 2002

Rem ADU Device pipe functions
Declare Function OpenAduDevice Lib "AduHid.DLL" _
(ByVal iTimeout As Long) As Long

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

Declare Function OpenAduDeviceBySerialNumber Lib "AduHid.DLL" _
(ByVal sSerialNumber As String, _
ByVal iTimeout As Long) As Long

Declare Function WriteAduDevice Lib "AduHid.DLL" _
(ByVal aduHandle As Long, ByVal lpBuffer As String, _
ByVal lNumberOfBytesToWrite As Long, _
ByRef lBytesWritten As Long, ByVal iTimeout As Long) As Long

Declare Function ReadAduDevice Lib "AduHid.DLL" _
(ByVal aduHandle As Long, ByVal lpBuffer As String, _
ByVal lNumberOfBytesToRead As Long, _
ByRef lBytesRead As Long, ByVal iTimeout As Long) As Long

Declare Function CloseAduDevice Lib "AduHid.DLL" _
(ByVal iHandle As Long) As Long

Rem RS232 pipe functions
Declare Function OpenAdu232 Lib "AduHid.DLL" _
(ByVal iTimeout As Long) As Long

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

Declare Function OpenAdu232BySerialNumber Lib "AduHid.DLL" _
(ByVal sSerialNumber As String, _
ByVal iTimeout As Long) As Long

Declare Function WriteAdu232 Lib "AduHid.DLL" _
(ByVal aduHandle As Long, ByVal lpBuffer As String, _
ByVal lNumberOfBytesToWrite As Long, _
ByRef lBytesWritten As Long, ByVal iTimeout As Long) As Long

Declare Function ReadAdu232 Lib "AduHid.DLL" _
(ByVal aduHandle As Long, ByVal lpBuffer As String, _
ByVal lNumberOfBytesToRead As Long, _
ByRef lBytesRead As Long, ByVal iTimeout As Long) As Long

Declare Function CloseAdu232 Lib "AduHid.DLL" _
(ByVal iHandle As Long) As Long

Rem Stream pipe functions
Declare Function OpenAduStream Lib "AduHid.DLL" _
(ByVal iTimeout As Long) As Long

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

Declare Function OpenAduStreamBySerialNumber Lib "AduHid.DLL" _
(ByVal sSerialNumber As String, _
ByVal iTimeout As Long) As Long

Rem you cannot write to the stream pipe

Declare Function ReadAduStream Lib "AduHid.DLL" _
(ByVal aduHandle As Long, ByVal lpBuffer As String, _
ByVal lNumberOfBytesToRead As Long, _
ByRef lBytesRead As Long, ByVal iTimeout As Long) As Long

Declare Function CloseAduStream Lib "AduHid.DLL" _
(ByVal iHandle As Long) As Long

Rem General functions
Type ADU_DEVICE_ID
    iVendorId As Integer
    iProductId As Integer
    sSerialNumber As String * 7
End Type

Declare Function ShowAduDeviceList Lib "AduHid.DLL" _
(ByRef pAduDeviceId As ADU_DEVICE_ID, _
ByVal sPrompt As Any) As Long