LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert labview VI to C code

Hi,
I've to translate LabvIEW code to C code (CVI). Does any exist?
 
Thank you in advance.
 
Bim
0 Kudos
Message 1 of 11
(32,551 Views)
Not really. There's LabVIEW Embedded which will generate C code but it only supports a subset of the LabVIEW functions and it costs upwards of U$10000 so it's not really practical as a conversion tool. Why do you have to convert? If you have the app builder, you can create a dll from the LabVIEW program and call that in CVI. Even if you don't already own the app builder, buying it would probably more economical than re-writing a bunch of code.
0 Kudos
Message 2 of 11
(32,550 Views)

Thanks for your answer,

The purpose is to adapt drivers, tested via LabVIEW, into C in order to load it in our device (real time). So we're close of the hardware and we must have a "light" code.

Concerning the use of a dll or of an exe, don't we need to install the LV runtime engine (heavy) and all associates runtimes to get it running? If true, the installation and use of the program should take more place and time than using a simple C executable?

I still have a few misunderstanding concerning the portability of LabVIEW code, even in exe or dll...

 

 

0 Kudos
Message 3 of 11
(32,529 Views)

No matter what, you will still need the same hardware drivers installed (i.e. NI-GPIB, NI-VISA). CVI also requires a run-time engine (as does VB, .NET, .etc). I've used CVI since version 1.0 (before it was even called CVI) and I don't believe that it runs faster than LabVIEW in all cases. A lot depends on the type of functions you are using and how you've written the code. If you are using GPIB, most of the execution time will be spent on data transfer over the slow GPIB bus. LabVIEW and CVI make calls into essentially the same dlls for DAQ so there shouldn't be much difference there.

Also, don't forget that there is LabVIEW RT.

Message 4 of 11
(32,520 Views)

Hello bimbim.

Dennis is absolutely right in what he said.

And regarding your "I still have a few misunderstanding concerning the portability of LabVIEW code, even in exe or dll...": Why not calling a NI sales representative   or   starting a small research at ni.com/labview ?   I think both will helpful to find a good decision.

Best regards, Guenter

0 Kudos
Message 5 of 11
(32,499 Views)


@bimbim wrote:

Thanks for your answer,

The purpose is to adapt drivers, tested via LabVIEW, into C in order to load it in our device (real time). So we're close of the hardware and we must have a "light" code.

Concerning the use of a dll or of an exe, don't we need to install the LV runtime engine (heavy) and all associates runtimes to get it running? If true, the installation and use of the program should take more place and time than using a simple C executable?

I still have a few misunderstanding concerning the portability of LabVIEW code, even in exe or dll...


As Dennis already has pointed out: The only sort of LabVIEW to C converter is part of the LabVIEW embedded system. It's C code however is only supporting a subset of LabVIEW (no IO libraries and some of the more advanced internal nodes) and not really meant to be used as a C code for further use outside of LabVIEW embedded. It's readibility as normal C code is quite hairy eventhough it is syntactically C.
In fact it won't even compile on other systems easily as LabVIEW embedded comes with quite some specific runtime support to connect to the compiled code on the target system and do quite a lot of other things too, which all get built into the executable as well and which all will be used directly or indirectly by the created C code.

CVI has a runtime too, and I'm not sure what you mean with all its associated other runtimes.

LabVIEW code in source code is generally portable across all LabVIEW platforms of the same version and also into newer versions. LabVIEW executables are only portable inside the family of system they were created for. This family is both a combination of OS and CPU. So LabVIEW created for Windows will run on all supported Windows platforms (the newest version only supports 2000/XP/2003 anymore) but not on Linux, MacOSX or an RT system.
An executable for MacOSX will only run on MacOSX but I think on most of their versions although there have been specific issues with certain OS versions. If you happen to have an Intel Mac it would only run on a dual boot system with XP on it too, or in the emulation environment called Rosetta if they didn't rename that in the meantime.

Basically if the OS type changes or the CPU, you can't use an executable anymore other than in certain emulation environments that provide the old environment.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 11
(32,473 Views)
Thank you all for your advices.
I'll now be more confident of LabVIEW performances versus C code!
 
 
0 Kudos
Message 7 of 11
(32,457 Views)
Hello everyone,
 
In an attempt to try to catch everyone who might have a LabWindows/CVI and Linux or Real-Time interest, I'm going to repost this information in this thread as well. I know this thread has been going on for a few years now, but I wanted to update whoever is interested in the latest LabWindows/CVI modules that we've released to try to address your multiplatform support needs:
 
So we now have a Real-Time Module, which allows you to develop LabWindows/CVI apps on a Windows machine and run on a real-time PXI or PC target.
Also, to partly address the main subject of this thread, in August, we release the Run-Time Module for Linux, which similarly allows you to develop on a Windows machine as you always have with CVI, and then run your application on multiple Linux distributions.
 
That's a brief overview of the latest modules, but if you want more information on what hardware is supported and also a more in-depth discussion on the module, take a look at the following resources:
Real-Time Module: www.ni.com/lwcvi/realtime
 
Thanks.
0 Kudos
Message 8 of 11
(32,298 Views)

hi, i am beginner in labview....i hav to improve coding skills for doing  projects.so,give me the idea to improve it...

0 Kudos
Message 9 of 11
(24,032 Views)

@453443474 wrote:

hi, i am beginner in labview....i hav to improve coding skills for doing  projects.so,give me the idea to improve it...


You have hijacked a quite old thread. And your question do not have anything to do with the original question. Please start a NEW thread. And also remember good questions draw good answers. Spend some time and explain why and how you struggle. Shall we start in that end



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 11
(24,024 Views)