Important: an upgraded version of this application is available here; Using C# with ADU USB Data Acquisition Products (Visual Studio 2019)
ADU Data Acquisition Interface Products
This page describes a sample C# program that uses the AduHid DLL to
communicate with an Ontrak ADU USB Interface Device.
The source code can be viewed by using Visual Studio dot net to open the AduSharp.sln
solution file.
The AduSharp sample is a minimal application that demonstrates:
For the sake of clarity the sample program neglects all error checking and exception
handling.
The sample is intended for tutorial purposes only.
The AduHid is a C DLL and needs the System Runtime InteropServices
to allow access from a C# application.
The example code expects to find the AduHid DLL in the same directory as the AduSharp.exe
file.
The AduHid DLL returns a character string as a null-terminated ASCII
string.
Use the StringBuilder class to allocate a buffer for the returned string.
The buffer can be converted to a System.String with the StringBuffer.ToString() function.
Further details about using the AduHid DLL can be found in the SDK available from the programming section of this website.