From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling external dll functions that take C++ vectors

I'm trying to use a shared library in LabView, but I'm having trouble figuring out how to get certain functions to work.  Specifically, the functions I'm having trouble with take C++ vectors as inputs (vector<double>& to be exact).  Can I pass LabView data to such functions?  The LV documentation seems to suggest that I can, but I don't see anything that explains how.

 

Do I have to develop a wrapper to use vectors?  Would arrays be better?

 

I created the shared library, so I can change it, but I would prefer not to.

0 Kudos
Message 1 of 3
(2,213 Views)

You cannot pass a C++ class from LabVIEW to a DLL.  Write a wrapper that takes a standard 1-D array, which you can pass easily.

0 Kudos
Message 2 of 3
(2,205 Views)

No C++ object datatypes can not be passed by LabVIEW. Generally C++ objects datatypes can not even be passed between object modules that are not compiled in the same compiler version, as the C++ ABI differs greatly between different compilers and even different versions of the same compiler.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,190 Views)