LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does labview 7 allow complex data structures in dll calls

Or do I need to write a dll wrapper. If so, it begs the question why not use VB, C# instead for the whole application. Note to NI: This is a serious omission from labview I am finding more and more that I need to call dlls to communicate with devices. I really don't want to write my applications in two different languages.
0 Kudos
Message 1 of 6
(3,343 Views)
That's why I use CVI, but the boss wants me to use LV. I hope this damn
economy improves.

vishi

"mr_e_cat" wrote in message
news:5065000000080000008E910000-1042324653000@exchange.ni.com...
> Or do I need to write a dll wrapper. If so, it begs the question why
> not use VB, C# instead for the whole application. Note to NI: This
> is a serious omission from labview I am finding more and more that
> I need to call dlls to communicate with devices. I really don't want
> to write my applications in two different languages.
Message 2 of 6
(3,343 Views)
Sorry, I don't have an answer to your question, just a related observation:
----> Interestingly, if you e.g. look inside the FFT VIs inside vi.lib, you can see that they utilize complex data with "call library nodes".

I am curious if somebody had more insight into this.
0 Kudos
Message 3 of 6
(3,343 Views)
I was wondering what structures you would like LabVIEW to support. Or do you want a better way to create the interface? I have seen some super huge structures that needed an interface because implementing the interface in LabVIEW was too tedius.
0 Kudos
Message 4 of 6
(3,343 Views)
> ----> Interestingly, if you e.g. look inside the FFT VIs inside
> vi.lib, you can see that they utilize complex data with "call library
> nodes".
>

I didn't actually see the call you are talking about, but the issue here
is that it isn't impossible to do structs, just advanced. The issue is
that C defines what goes on here. It combines allocation and
deallocation responsibility with passing things largely on a stack.
Finally, compilers do different things on different platforms. On some
of them, passing a struct of flat items will be the same as ignoreing
the struct and simply passing the elements. On others the struct will
be passed by reference or doing a copy-in/copy-out like fortran
typically did.

Anyway, I've been hoping that some
one would write a document showing
what is possible on Windows. With a bit of knowledge for what the
compiler does, one could achieve this in more of the cases without a
wrapper DLL, but the details are advanced.
0 Kudos
Message 5 of 6
(3,343 Views)
Back in the LabVIEW 5 days (and on up until now), I was able to write a whole zoo of functions that all called DLLs that required complex structures as parameters. Most of the time, you can just build a cluster with all the elements in the struct and flatten it to a string. Be careful about element order, endian-ness, and word boundaries.

If you have some clear specifications for your whole application, consider hiring an Alliance Member (like us). You will end up with a most professional example of LabVIEW code to learn from and tweak as you like.

Alliance Members are here to help. We do this stuff every day.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
0 Kudos
Message 6 of 6
(3,343 Views)