top01.jpg (17169 bytes)
mleft.jpg (4986 bytes) m01a.jpg (6169 bytes)     m02a.jpg (6905 bytes)     m03a.jpg (7743 bytes)    m04a.jpg (7456 bytes)     m05a.jpg (7878 bytes)     m06a.jpg (6862 bytes)     m07a.jpg (6076 bytes) mright01.jpg (5078 bytes)

Using VB.NET with ADU USB Data Acquisition Products

( AduHid.DLL)


ADU200s.jpg (4210 bytes) ADU Data Acquisition Interface Products


The AduHid DLL can be used directly from a Visual Basic dot net
application. Some adjustments must be to the Visual Basic code
to allow execution within the Common Language Runtime.

The zip file, AduHid-Eg-VB-Net.ZIP, contains a sample Visual
Basic project that was converted from VB6.0 to VB.net using
the automated upgrade tool provided with Visual Studio dot net.
All source code is provided so that you may review details that
are not highlighted here.

The resulting executable, Project1.exe, was tested under
Windows XP.


Highlights of changes:
---------------------------------------------------------------------------------------------------------

1) Change the sSerialNumber declaration in the ADU_DEVICE_ID
structure so that it includes marshalling arguments.
The delcaration should read as follows.


<VBFixedString(7),System.Runtime.InteropServices.MarshalAs (System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=7)> Public sSerialNumber As String

2) Change the declaration of the ShowList function so that sPrompt
has a type of String.
The declaration should read as follows.


Declare Function ShowAduDeviceList Lib "AduHid.DLL" (ByRef pAduDeviceId As ADU_DEVICE_ID, ByVal sPrompt As String) As Integer

NOTES:
---------------------------------------------------------------------------------------------------------

The AduHid DLL is a legacy DLL. It is not a COM object.
It is not an "assembly".
DO NOT specify the the AduHid DLL as a reference.
(ie DO NOT use -r on the command line for AduHid.dll)

The AduHid.dll must be copied into the sub-directory that
contains the EXE file.
(ie. in the example the "Project1.NET/bin" sub-directory contains both
the Project1.exe AND AduHid.dll)


DOWNLOAD VB.NET Example Files in ZIP format. ( 65K )

 

NEWS         PRODUCTS         PROGRAMMING          APPLICATIONS          CUSTOM DESIGN          ORDERING          HOME


TestPoint is a trademark of Capital Equipment Corp.   
LabVIEW is a trademark of National Instruments.
Visual BASIC is a trademark of Microsoft Corporation


Copyright © 2003 ONTRAK CONTROL SYSTEMS 764 Notre Dame Ave, Unit #1 , Sudbury, Ontario, CANADA P3A 2T2  
"Quality serial Data Acquisition Interfaces"           PH. (705) 671-2652 FAX (705) 671-6127