LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select one of several FPGA VIs at runtime under RT program control

I need a CRIO RT controller to select one of several FPGA VIs (or bitfiles) at runtime based on an operating mode parameter.

The application requires the FPGA to acquire and process data using several different techniques based on a user supplied mode parameter.  Each individual technique will fit into the FPGA, but there is not enough room to fit all of the techniques into the FPGA at the same time.  Therefore, I need a way to programmatically select one of the FPGA VIs or bitfiles at runtime.  The processed data is transferred to the RT through a common DMA FIFO, and all controls and I/O can be the same for each of the VIs.

I tried using a Case Structure on the RT to select the appropriate Open FPGA VI Reference call based on the current operating mode.  When I wired the RefNum output from each case to the common output tunnel, I got an error stating that the RefNums were of different types.

I then tried binding the Open FPGA VI Reference calls to TypeDef or StrictTypeDef controls.  In both cases there was an error stating that some of the Open FPGA VI Reference calls were bound to a TypeDef control which had changed.

Is it possible to select an FPGA VI or bitfile at runtime?

If not, is there a way to force the FPGA compiler to layout multiple VIs with the same interface structure so that the RT VI doesn't care which version is running?

If not, any suggestions short of duplicating the entire RT VI for each FPGA instance?

Thanks!
0 Kudos
Message 1 of 4
(2,931 Views)
Perhaps you need to use the Up Cast function (under FPGA
Interface>Advanced). It is possible to do this form a host PC, but I'm not
sure if it is possible form a RT controller.

Btw. You can only do this a few thousend (like 10000 - 100000) times, since
the memory will wear down. If you are going to do automated test like this,
and you upload a different VI each second, your FPGA won't last very long.
It would be much better if it could fit, but I guess you've tried that...

Regards,

Wiebe.


0 Kudos
Message 2 of 4
(2,914 Views)
Thanks for the suggestions.  I tried the upcast, but it doesn't appear to retain enough information specific to the FPGA VI being called and the RefNum isn't valid for subsequent use.

Regarding the re-programming frequency, the mode of operation would not be changed very often, so I'm not worried about wearing out the memory in the FPGA.  I'm more concerned with simplicity since the system will be used in a production environment by non-programmers. They will communicate with the cRIO only through an extension to a proprietary front-end that already exists.  They won't have direct access to LabVIEW and therefore can't use any of the normal tools for reconfiguring the FPGA.
0 Kudos
Message 3 of 4
(2,907 Views)

JohnZ wrote:

Is it possible to select an FPGA VI or bitfile at runtime?


Yes, using the FPGA Open VI Reference function as you are already doing, but you need a separate Open FPGA VI reference for each version of the FPGA VI or bitstream.
 


If not, is there a way to force the FPGA compiler to layout multiple VIs with the same interface structure so that the RT VI doesn't care which version is running?


No, the FPGA VI reference for each FPGA VI will be unique due to information about the interface and VI that is stored as part of the reference. If you are not using DMA in the FPGA VI, then you can use the Upcast function to convert the FPGA Reference into a more generic form which can be used interchangably with other FPGA references that have the same front panel configuration.
 

If not, any suggestions short of duplicating the entire RT VI for each FPGA instance?

Unfortunately no.
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


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