LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to compile and link the LabView program(G) with some function written in C?

Before, some employee in our company developed some program which was written in LabView (G). Now we want to add some new function with has already been done in C++. Can we combine them together? how to do it?
0 Kudos
Message 1 of 3
(2,778 Views)
Hi;

To use external code in LabVIEW, you can create a dynamic link library (.dll) that you can call from LabVIEW or a Code Interface Node (CIN). The instructions on how to make any of those are in National Instruments manual Using External Code in LabVIEW, which is included with LabVIEW, or you can download it from NI website.

Also, in the knowledge base there is a "External Code for LabVIEW - CIN / DLL - Starting Point" page.

If, on the contrary, you want to use LabVIEW code on your C application, you can build dll's in LabVIEW. Depending on your version of LabVIEW, you may need Application Builder to do so.

Of course, you can also use other techniques like, for example, making that your LabVIEW application save the data in a file and then your C++ application read the file and continues from there, or vice versa. You can also use the "System Exec.vi" in LabVIEw to do that, assuming your C code is an executable.

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 2 of 3
(2,778 Views)
Hi may,

What you are asking could get quite complicated depending on the details. If this task is of value to your company, you may want to concider contacting one NI's Select Integrators to come in and do a one day consulting project.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 3
(2,778 Views)