LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C generator for Labview 2016

 

Is there any chance to generate C project from basic myIncrem.vi (for example) created in LabView 2016 (32-bit)?

I can not install the LabView2015 C Generator because I have not the older version of NI LabView (NI LabView 2015 32-bit). 

I would like to compile created C project to .so library for Linux.

 

Thank you very much for your reply and any help.

Michal

 

0 Kudos
Message 1 of 9
(7,416 Views)

Why not create a shared library (.so or .dll) through standard way - Tools -> Build Application (EXE) from VI. There you could set up your build specs to generate a library instead of executable.

0 Kudos
Message 2 of 9
(7,354 Views)

It is simple, I need linux library from win LabView project, but I do not have Linux LabView which can compile .vi to .so library.

My win Labview 2016 can creat only .dll and .lib librarys.

0 Kudos
Message 3 of 9
(7,351 Views)

Well, then you could fire up any modern Linux OS on VirtualBox or VMWare and install LabVIEW there to get your .so files compiled. If you don't have LabVIEW for Linux then get in touch with your local NI representatives and maybe they will help you. Also I have seen some older distros around the net freely available (e.g. 2010 one), but it seems to be not completely legal, probably.

 

As to C Generator, my little experience says that you would get some "garbage" code close to that you'd get with disassembly utils. So, it's unlikely to be compiled back to useful library.

0 Kudos
Message 4 of 9
(7,304 Views)

@dadreamer wrote:

Well, then you could fire up any modern Linux OS on VirtualBox or VMWare and install LabVIEW there to get your .so files compiled. If you don't have LabVIEW for Linux then get in touch with your local NI representatives and maybe they will help you. Also I have seen some older distros around the net freely available (e.g. 2010 one), but it seems to be not completely legal, probably.

 That's the understatment of the year. It is simply and completely illegal. 

 

As to C Generator, my little experience says that you would get some "garbage" code close to that you'd get with disassembly utils. So, it's unlikely to be compiled back to useful library.


It's not garbage code and not impossible to compile, but it's far from easily human readable. 

 

However if you have a normal LabVIEW license and not some special one, your 2016 license should entitle you to install 2015 too on your computer. That would be probably the easiest thing to do.

 

The created C code may however be not directly compilable under a Linux GCC since it was also created under Windows and could contain Windows specific function calls.

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 9
(7,282 Views)

@rolfk wrote:

 That's the understatment of the year. It is simply and completely illegal. 


As I can recall, there were several promo actions, where LabVIEW for Linux was issued absolutely free (as that one for Heise magazine). Do you think, it's illegal?

 


@rolfk wrote:

 It's not garbage code and not impossible to compile, but it's far from easily human readable.  


I doubt that TC would be able to compile anything from such code so it's like a "garbage" for him. The effect is like you'd get a pseudocode with IDA and try to build it into common library or executable.

0 Kudos
Message 6 of 9
(7,269 Views)

@dadreamer wrote:

@rolfk wrote:

 That's the understatment of the year. It is simply and completely illegal. 


As I can recall, there were several promo actions, where LabVIEW for Linux was issued absolutely free (as that one for Heise magazine). Do you think, it's illegal?

 To the best of my knowledge that was LabVIEW 6.1 or so and has not been repeated since.

 


@rolfk wrote:

 It's not garbage code and not impossible to compile, but it's far from easily human readable.  


I doubt that TC would be able to compile anything from such code so it's like a "garbage" for him. The effect is like you'd get a pseudocode with IDA and try to build it into common library or executable.


The issue that it can not be compiled with every possible compiler out there is of course even with very well and neatly written C code a very common problem. However the C Generator is/was used as part of the backend for some of the more exotic Toolkits like the LabVIEW for ARM or LabVIEW for AMD Blackfin Embedded Toolkits so it definitely can create code that can be compiled by certain compilers.

 

It's not exactly comparable with IDA pseudocode either. IDA tries to recognize machine code patterns and translates them back into pseudo C code. This is necessarily an almost impossible task to do fully cleanly as the C compiler did all kinds of transformations such as code optimizations and rescheduling and what else, such that those transformations can only be reversed if you know exactly which compiler was used and which version and then you still are not really able to create fully compilable code easily.

 

In the case of the LabVIEW C generator it starts from a much more specific and accurate intermediate code representation (DFIR) that goes in normal LabVIEW operation through various optimization transformations and then to the LLVM code generator, which will then generate the actual machine code. This intermediate code representation knows every single bit of the original code and has therefore a lot more information to create real and working code. That the translation from DFIR into C is absolutely nothing trivial should be clear, any C compiler typically contains exactly the opposite as it creates some form of DFIR like description from the C code in order to perform lots of different optimization transformations on it before compiling it into the target machine code, but it is not at all comparable to the creation of pseudo C code from compiled machine code, which is lacking most of the original context of the source code more or less completely.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 7 of 9
(7,257 Views)

Thank you for all your answers.

 

Please where can I download trial LabView for Linux or buy original LabView for Linux?

 

0 Kudos
Message 8 of 9
(7,254 Views)

Hi Dantes,

 

go to www.ni.com

(You will even find phone numbers for your local NI sales rep!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(7,242 Views)