LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW FPGA Dynamic Mode + Bind to Typdef (Dynamic Import from Bitfile + Autoupdate Typdef)

Solved!
Go to solution

Hello,

 

I have created multiple FPGA bitfiles for different targets and dynamically deploy them to the cRIO, all of that works fine.

I have typedefs of "FPGA Interface Dynamic" which I use "Dynamic FPGA Inteface Cast" which I use on my cRIO app to cast the references to the appropriate type, that all works fine.

 

It would be convient for me to combine the behavior of "Dynamic Mode" and "Bind FPGA Host Reference to type definition" so that anytime I modify a bitfile, I could script the updating/importing of the typedef.

Gryffin_3-1700677395266.png

 

When you right click a FPGA reference on the block diagram and select "Configure FPGA VI Reference", you are greeted with this prompt which allows you to import from a .lvbitx:

Gryffin_0-1700676989140.png

Is this prompt available as a VI?

 

I would ultimately like to:

  1. Open a preexisting ".ctl" of "Strict Typdef" of "FPGA Interface Dynamic".
  2. "Import from bitfile" automatically for a set file path
  3. Close the updated typdef and propagate changes to all instances

This is acheivable conventionally with just a few button clicks, but I would like to automate my entire build process.

 

Is this possible? Any suggestions?

0 Kudos
Message 1 of 8
(33,336 Views)
Solution
Accepted by topic author Gryffin

Hi Gryffin,

 

If you are familiar with VI scripting and a bit with XNodes, you may find what you want in folder:

"<LabVIEW>\vi.lib\rvi\ClientSDK\Core\Script\FpgaInterface\OpenFpgaVI"

 

Attached is an example script that does what you described. It uses some of the private FPGA scripting VIs to configure an "Open FPGA VI Reference" XNode from a bitfile. It then creates an indicator from its output and copy it to a type definition.

 

Regards,

Raphaël.

Message 2 of 8
(33,287 Views)

You can consider using LabVIEW FPGA Advanced Session Resources to load lvbitx dynamically.

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 3 of 8
(33,279 Views)

Similar post about scripting an FPGA reference and the use of the LabVIEW FPGA Advanced Session Resources:

https://forums.ni.com/t5/LabVIEW/Script-FPGA-Reference/m-p/4245121

0 Kudos
Message 4 of 8
(33,272 Views)

This is a very helpful VI but only acheives half on my desired goal.

 

If a change is made to the bitfile (add a control to the front panel), the output terminal of "Dummy Open FPGA VI Reference.vi" doesn't autoupdate (it breaks).

 

Is there a way to script/autoupdate the output of this VI so that it always matches the output of "Open FPGA VI Reference"?

0 Kudos
Message 5 of 8
(33,243 Views)

You just need to execute the script and it will update your type definition from the bitfile.

No need to care about the Dummy VI, this is just an intermediary for the scripting.

 

0 Kudos
Message 6 of 8
(33,240 Views)

Thank you so much!

This is exactly what I was looking for.

 

I attach a slightly modified version which allows for dynamic file path entry of the bitfile, typedef to update, and the path to the "Open FPGA VI Stub" VI which should only contain a "Open FPGA Reference" (as seen below, pretty sure the constant and error feedback is unnecessary). LV2023 Q3

 

Gryffin_0-1700919857806.png

<Example of "FPGA VI Stub.VI">

 

 

I also closed all references and and wired error throughout, I hope this helps others in the future.

0 Kudos
Message 7 of 8
(33,217 Views)

I'm glad it helped.

 

When posting a VI, don't forget to save for previous version (max LV 21.0) so that most people can open it.

0 Kudos
Message 8 of 8
(33,139 Views)