10-12-2015 03:44 AM
Hi, I have LabVIEW 2013 and I need to create a Vi in which I control some input and output signals for a NI PCIe. This VI has to be integrated in a bigger program developed in C++ in Visual Studio Community 2015. Searching in the net I've found many topics about using Visual Studio's dll in LabVIEW, but I think that in this case I have to do the opposite process because the main program runs in Visual Studio and I should call the LabVIEW VI from there. So my question is: which are the steps to do this? Any suggestion will be very helpful!!
Solved! Go to Solution.
10-12-2015 03:53 AM
First of all: I personally recommend you to implement the DAQmx directly in C++. Sounds strange, but it makes debugging much easier during integration.
That being said, you can compile LV code into DLLs using the LV Application Builder. You can call these DLLs from C++.
Execution of LV based DLLs require the LV Runtime Engine of the appropriate version to be installed on the target computer.
Norbert
10-12-2015 03:56 AM
If you have the Application Builder or the Professional Development System you can not only create executables from LabVIEW code but also DLLs. Turn your VI into a DLL and call that from your Visual Studio application. Alternatingly you could also select to create a .Net assembly and call it as such. For C++ however I would choose the DLL path.
A few notes: A LabVIEW DLL requires the LabVIEW runtime to be installed on every computer you want to use that DLL on. Also of course any extra drivers like DAQmx etc if you use them in your VIs. You can create an installer too when you have the Application Builder that includes all those dependencies if you want.
Last but not least LabVIEW DLLs (and executables) are compiled for the target CPU architecture on which they are created so if you use LabVIEW 32 Bit the resulting DLL will be only executable in a Windows 32 Bit process. It's not a WinRT component that you can move from one platform to a different platform.