Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure the Call Library Function for a function prototype with return="void *"

I am calling a hardware driver API.

How should I configure the Labview call library function for the following function?

void * __stdcall OpenAduDevice(unsigned long iTimeout);

It seems impossible in labview to set the return type to "void * ". I tried to use "unsigned long" instead, I managed to communicate with the device but labview tends to crash.

The handle value must be retained by Labview and used in subsequent WriteAduDevice, ReadAduDevice and CloseAduDevice function calls. Here is the CloseAduDevice function prototype:

void __stdcall CloseAduDevice(void * hDevice);

Should I use the type "Adapt to type" in labview call library function? It is the only type
that makes the function prototype correspond. Which data format should I use then, "Handles by Value" or "Pointers to Handles"?

See http://www.ontrak.net/ADUSDK/AduCmdPipe.html
for more information on the functions.
0 Kudos
Message 1 of 2
(3,201 Views)
Hi FR6,

For your first question, I believe the answer is in this post.


For your second question, a pointer is just a 32-bit integer value that represents the location of the data, so what you will be doing is just passing this "location" value from one DLL to the other. Hope this helps!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 2 of 2
(3,201 Views)