Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Update RT to include new FPGA Variables/Controls

Solved!
Go to solution

I feel silly having to ask this, but I have been battling for 2 hours now to no avail.  I have a RT Host and FPGA target that run just fine together (sbRIO-9636).  I recently decided to add 4 new controls (analog inputs) to the sbRIO.  I added them to the FPGA module and they measure and read just fine.  However, when I try to use the "FPGA Read/Write Control" on my RT Host these four new variables are not showing up.  I created shared variables for them and deployed them, but still nothing.  When I perform a shared-variable node I can see them as options, but I cannot access their analog data in the RT module vi.  Do I need to perform a refresh?  I have run both the RT and the FPGA stand-alone and they run fine.  I am just not getting all of the data passed to the RT host.

 

Any help is appreciated.

 

gerin99

0 Kudos
Message 1 of 5
(7,405 Views)

Hello gerin99, 

 

In order to use a Read/Write control in your real-time code, you need to write the data to front panel indicators on the FPGA VI.  The FPGA Read/Write Control pulls data from those front panel objects.  You will need to take the data coming from the IO Nodes in your FPGA VI and write it to indicators on the front panel.  You can then open an FPGA VI reference in the real-time VI, and select those FPGA front panel objects in the FPGA Read/Write Control node.

 

Shared variables deployed to the real-time controller will not be accessible to the FPGA, though you can use something called a user-defined variable if your hardware supports the Scan Engine (see the linked document below).  It looks like the sbRIO-9636 does not support the Scan Engine, so don't worry about user-defined variables.  

 

Here is some information on three ways to transfer data between the FPGA and the real-time VIs:  

 

Transferring Data between the FPGA and the Host (FPGA Module)

http://zone.ni.com/reference/en-XX/help/371599F-01/lvfpgaconcepts/pfi_data_transfer/#FP_Communicatio...

0 Kudos
Message 2 of 5
(7,373 Views)
Solution
Accepted by topic author gerin99
You should also check the FPGA reference you are using in your RT code. If the reference is pointing to the previous bitfile, rather than your new one, then the controls won't show up because they aren't in the old file. This has tripped me up a couple of times in the past. Wire Warrior
Wire Warrior

Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!
Message 3 of 5
(7,360 Views)

Wire_Warrior...how do I check what bitfile it is pointing to.  For some reason I remember running into this issue in the past and that is how I have solved it.  I checked and my variables do have indicators on the FPGA front panel, so the first recommendation is not too helpful.  I am still going to follow some of his suggestions, but I have a feeling your suggestion is the solution.

0 Kudos
Message 4 of 5
(7,358 Views)

Wire_Warrior,

 

I looked into the bitfile that the FPGA Open was referrencing and you were right.  For some reason it was referencing an old bitfile.  Updated the directory and BANG, there they were.

 

Thanks for the help,

gerin99

0 Kudos
Message 5 of 5
(7,352 Views)