12-23-2016 07:52 AM
I want to analyze in data processing algorithms supplied by a contractor as vi files, 2016 format. Beside viewing the vi hierarchy, it would be very helpful if I could generate C code from the vi format for a more detailed analysis. I see there is the LVCGenerator2015 for LabView 2015 for generating C code, but I cannot find the corresponding package for LabVIEW 2016. LabVIEW 2015 is not "forward compatible" in the respect. Is there any other options for my purpose?
Solved! Go to Solution.
12-23-2016 10:43 AM
Hi gschiavone,
call your local NI representative for this topic.
Ask him/her about LabVIEW to C conversion…
General answer: yes, there is a tool to convert LabVIEW VIs to C code. But it's expensive AFAIK - maybe too expensive for just analyzing some vendor supplied code…
What exactly do you want to analyze?
12-27-2016 09:48 AM
Data is collected from multiple sensors though cRIO, then post-processed under Windows. I need to analyze the post-processing computer vision algorithms that were provided by the contractor.
12-27-2016 10:04 AM
12-27-2016 10:10 AM
I would still follow The advice of GerdW but I would suspect that even if it did did see The generated C code it would just go to vision dlls for any of the interesting parts. What exactly are you looking to get out of this analysis? From the little I know about the C code generator this doesn't seem like a typical use case.
12-28-2016 01:51 AM
Others have already told you more or less the same. The C code generator, as impressive as it is from a comuter programming viewpoint is most likely not what you want to do.
Aside from the exorbitant price (last time I checked) that makes it most likely a complete nogo for your intentions, there is the issue that the machine generated code is anything but your typical programmer written code. It is machine readable (a C compiler can process it) but hardly human readable. And as someone else said, it most likely will call lots of external code library functions to do the really hard parts of the code.
Unless you don't understand a LabVIEW diagram at all, I'm almost certain that analyzing the LabVIEW diagram directly is a much more straightforward approach than converting everything into C code and trying to understand that code in any way.
12-28-2016 09:16 AM
If you have the LV2015 tool, you can probably ask the supplier to downsave in 2015 format (i assume 2016 can save in 2015 format). There might be some artifacts and it might not be able to run, but for your goal it shouldn't matter.
/Y
12-28-2016 10:04 AM
@Yamaeda wrote:
If you have the LV2015 tool, you can probably ask the supplier to downsave in 2015 format (i assume 2016 can save in 2015 format). There might be some artifacts and it might not be able to run, but for your goal it shouldn't matter.
/Y
I'm not sure how that would help. The OP probably does own LabVIEW 2016 already but was looking for the 2016 compatible C converter. So he could do the downgrade to LabVIEW 2015 himself and then install 2015 with the C converter. However as pointed out already, the resulting code is most likely rather unsuitable to do an algorithme review at all and that together with the pretty high cost of the C converter would seem like a definitive KO for this approach.
12-28-2016 10:12 AM
I recall having to slog through machine generated C from good old "f2c" back in the day, difficult but not impossible. My review is limited to a small part of the code, so as long as the library functions are well-documented I will give this a try with some hope for results.
12-28-2016 10:27 AM
f2c sounds like Fortran to C. Both of these are procedural programming languages so their programming paradigma is fairly similar and translation from Fortran to C isn't such a big task. LabVIEW on the other hand is a dataflow based language.
Translating that into C without creating race conditions and other hairy programming problems is a non-trivial task to say the least. Accordingly the generated C(++) code is not at all optimized for human readability but for correct code execution. With the necessary extra indirections and complications to make this task at all managable.