LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a DLL in LabVIEW containing a function using pointer to pointer

Hi!
 
I´m facing the problem to create a DLL from LabVIEW containing the following C-function:
functionF(structS** arrayA) ,
where:
structS is a struct of various data-types (e.g. int)
arrayA is an C-array of structS
 
 
How can this be done? Any ideas?
 
Thank you in advance for your support
 
0 Kudos
Message 1 of 6
(3,026 Views)
This cannot be done in LabVIEW. LV doesn't have the data type "Pointer" as C has.
The only workaround I can think of is to use an array of strings in LV and in the interface define the parameter as "by reference". In LV you have to typecast the wire with the string to a cluster withthe layout of structS.
As far as I know an array of strings is represented as an array of pointer to strings. This is because strings are variable in length and therefore LV uses this method storing the pointers to the strings in the array and not the elements as usual.
You have to read the document about memory and data types of LabVIEW. In elder versions this was in the LabVIEW Bookshelf but I haven't found it in short in the newer version.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 6
(3,014 Views)
but if such function is written in C then can it be called in Labview??
thanks
0 Kudos
Message 3 of 6
(2,993 Views)

Thanks for your answer waldemar!

I like the idea with array of structs - sounds logical for me.

The problem is i can not fix the typecasts i would need. How should cast a cluster of strings and ints into an string? I think that´s not possible...

0 Kudos
Message 4 of 6
(2,961 Views)

sorry,

"array of strings" of course

0 Kudos
Message 5 of 6
(2,960 Views)

There´s no way doin´ this without a wrapper-dll. That´s what frightened me since the beginning. Anyway - no choice...

Hope this comes to a good end

0 Kudos
Message 6 of 6
(2,897 Views)