From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have two different PXI NI FPGA loads that I would like to be able to load programatically at run time depending on user option settings.

Solved!
Go to solution

How long does it take to load an FPGA bit file at run time? Can they be swapped at run time?

0 Kudos
Message 1 of 7
(2,718 Views)

You're  not going to be able to do this. I'm guessing an option for you would be to put your code inside a case structure with an enum control wired to that case structure. Put your code for one state inside one case, and your code for the other state inside the other case. You can then set this enum control from the RT which will put your FPGA into whichever state you would like to be running.

0 Kudos
Message 2 of 7
(2,715 Views)

I spoke with a NI application Engineer and he said that if my BIT files have been compiled and debugged, then they can be swapped around programmatically within LabView and depending on the size of the BIT file, it should take no longer than 10 seconds. I have not tried this out yet however.

Message 3 of 7
(2,709 Views)

Thats cool...that's something I didn't know. After you try, can you post a small example?

0 Kudos
Message 4 of 7
(2,699 Views)

Hey all,

 

It actually works exactly the way you normally open and run a bitfile. I've attached an little example I just used to test this question. It is compiled for the 9074, and what it does is just open a bitfile which makes the fpga light flash on and off for 10 seconds (2 second period) and then with a 1 second period. You can run the RT VI or build it as a start-up exe, both ways work fine. As a side note, this code is extremely simple (~5% resource usage), but the change from one bitfile to the next is seamless, not 10 seconds.

 

Thanks,

 

0 Kudos
Message 5 of 7
(2,683 Views)
Solution
Accepted by topic author jfeetham

Hey that's great, so what is the actual application start to application start time from load to load? Is it milliseconds?, seconds? Thanks

 

Jon

0 Kudos
Message 6 of 7
(2,675 Views)

Hey jfeetham,

 

I would say that that question is highly dependent upon your bitfile and your RT code, and not something that can be easily benchmarked except by individuals. My 5% resource usage bitfile ran at about 1.5 MB, while I have a bitfile which uses half of an FPGA weighing in at 800 KB. One thing that would definitely increase your speed is using the download method: http://zone.ni.com/reference/en-XX/help/371599F-01/lvfpgahost/fpga_method_download/

 

Open a reference to your fpga vi, uncheck the "Run" box, and then use the download method to send the bitfile over to the fpga. Then, when you are ready for it to run, use the run invoke method.

 

Thanks,

 

0 Kudos
Message 7 of 7
(2,668 Views)