LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you convert C or C++ code for use by labview?

I have a program written in C that I would like to convert so that I can use it in  a Labview VI.  I'm a familiar with C, but not real real good.  Does anyone have and advice or tips on what options there are for me to go about doing this?
Thanks.
0 Kudos
Message 1 of 3
(3,148 Views)

You have two ways to go about this.  The first is to take the existing C code and compile it into a DLL and call it from LabVIEW using the Call Library Node.  This way you don't have to recreate the existing algorithm.

If you want to recreate the entire thing in LabVIEW then the first step is to learn the LabVIEW constructs that are equivalent to your C constructs such as looping constructs (while, for), case structures (switch statement), and other primitives.

There is an example program that demonstrates an algorithm both in LabVIEW and the equivalent code in C that you might find useful.

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CB923111EE034080020E74861

If you have particular questions about a C statement and its equivalent in LabVIEW be sure to ask the forum.
0 Kudos
Message 2 of 3
(3,138 Views)
You could compile the C code into a dll and have LV make calls to it. Search the LV help bookshelf for calling external code.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 3 of 3
(3,123 Views)