LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a C pointer from call library function node

I have a client/server application which the client I am trying to develop using Labview.  When I use to communicate the server and the client using the program provided by the manufacter, the system works perfectly.
 
Now, I am trying to develop a system using labview, because I need to get another things.
 
I have the DLL provided by the manufacter and the .h too, so I can check the functions parameters. One of these functions needs to be called using a struct element. Probably, the function's DLL instantiates the elements of this struct.  I use the call library function node to do it.
 
When I receive the data, the function returns to me the struct that I passed as a parameter before, and then I can read all the elements of the struct, except the string element that returns nothing. The struct elements that are numerical, I can read them perfectly.
 
Another thing that is important to say, is that the string data was not returned in fact by the DLL function that the system calls. I have to pass a pointer (I use it as unsigned 16 in Labview, but I tried before as string and unsigned 😎 as a parameter, and this pointer will point to the memory location that the string is. When I try to read what is returned by the function, I can read nothing. The same function returns that the size of data that is returning is 17 bytes.
 
How can I solve it?
 
Thank you in advance
0 Kudos
Message 1 of 4
(2,854 Views)
Did you take a look at the example that ships with LabVIEW that shows how to do all sorts of data passing to DLLs. I believe your situation is one of the examples listed. You can find the example VI in the "<LabVIEW install directory>\examples\dll\data passing" directory.
0 Kudos
Message 2 of 4
(2,847 Views)

I checked this example before, but I didn't find an answer.

 

Message Edited by gborges on 08-01-2006 02:19 PM

0 Kudos
Message 3 of 4
(2,844 Views)
You could try looking at this example.  It seems to address what you are looking for.
0 Kudos
Message 4 of 4
(2,836 Views)