LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW code to machine code

Hi,

I have been using NI sbRIO for 3 years now in college for education purposes and it had served me as a great learning tool to build robots, create algorithms and deploy code with minimum development time and intuitive learning for students.
But there always had been a question lurking in my mind that how does a LabVIEW code gets compiled into a equivalent machine (binary) code to work with RT processor? Does it have any compilation tool (like Xilinx HLS tool to convert a LabVIEW diagram into bitstream)?

I know it's a very noob question to ask but I always had an impression from those of microcontrollers (AVR, PIC) where we first write a C/C++ code, compile it and generate a HEX file and then program our controller with a programmer.

Following questions linger on all the time whenever I create a project and deploy it over sbRIO:

1. How does LabVIEW convert a graphical code to a equivalent bitstream for FPGA?
2. Is it a good technique to first convert a LabVIEW VI to VHDL and then perform synthesis, mapping and bitstream? Isn't this process equivalent to some software which converts a VI into C++/C code and then creates a HEX file and then gets "BURNED" into a controller.

3. Does a graphical code get converted directly into machine language on the RT side? I know that for sure that a simple VI, running on a desktop, is converted directly into machine code.

 

I may not be able to clearly explain my questions but if someone could answer them I'd be really grateful. 🙂

 


0 Kudos
Message 1 of 4
(2,835 Views)

Hi Nap,

 

LabVIEW uses a compiler to generate executable code - regardless of the target!

 

There's a compiler to produce code for Windows PCs and there's a compiler to get code for the RT part of your sbRIO. And there's an additional compiler to create a FPGA bitfile (which is based on Xilinx tools).

 

And no, you don't need to create C code as "in between" step. Search for LLVM as it is used by LabVIEW for some versions now...

 

There also is an AppNote somewhere here on ni.com explaining that LLVM stuff!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,829 Views)

The very short answer is "NI takes care of all of that for you".

 

NI does compile LabVIEW code directly to machine code for you.  As already said, this same process is done for RT, Windows, Mac, Linux.  FPGA is a little different since NI actually generates VHDL code that the Xilinx compiler can compile to a FPGA bit file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,812 Views)

I wish I were a software engineer to understand the compiler theories. 
Thanks for the great stuff 🙂


0 Kudos
Message 4 of 4
(2,795 Views)