Showing results for 
Search instead for 
Did you mean: 

Are Sub VIs useful in LabVIEW FPGA?

Go to solution

I am developing code for the FPGA on a cRIO-9081.  In it there are 4 places that I want to wait different amount of time depending on what I am doing, the wait time are 8.3, 10.0, 53, and 200 seconds.  I don't want to use the WAIT VI, instead I want to use two TICK VIs and a WAIT VI that only wait 5 mSec to measure the elapsed time.  I created a Sub VI, see attachment that takes the seconds as inputs.


This got me started thinking about how the FPGA would implement the code.  Would it create 4 identical structures in the hardware or one structure with a switch to switch the inputs.


I think it would create 4 identical structures in the hardware, whereas Sub VIs in LabVIEW FPGA are not true subroutines that the code "jumps" to.


Can anyone tell me for sure?

0 Kudos
Message 1 of 3
Accepted by topic author Paul_Knight_Lockheed_Mart

It actually depends on your reentrancy setting for the VI.  If you have it set up to be non-reentrant, then it will be a shared fabric with mutexes added.  If you have it set up to be reentrant, which is the default for VIs made in the FPGA context, then the fabric will be duplicated for each call of that VI.

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 2 of 3


0 Kudos
Message 3 of 3