LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic item selection of FPGA Read/Write Control?

Hi,

 

I have a question about the FPGA Interface Read/Write Control node.

 

When creating the host VI, one has to select the FPGA controls/indicators which are going to be written/read through FPGA R/W node. Is there any way to select these controls/indicators at run-time? In case this behavior of the FPGA Interface Read/Write Control node is fixed, is there any workaround?

 

Regards,

Karsten

0 Kudos
Message 1 of 6
(3,402 Views)

Hi Karsten,

 

why do you want to have such a behaviour at runtime?

 

When you want to read/write different FPGA controls you could use case structures in your RT host…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,400 Views)

Hi Gerd,

 

Thank you for your quick reply. Of course, your suggestion is an option and probably I will end up with it if there is no workaround.

 

The setup connected to the cRIO will be changed from time to time but it will always consist of the same types of components (mainly valves, pumps and heaters). My thought is to have standard labels of controls in the FPGA VI (like Valve[i], Pump[j], Heater[k]) and to have the RT part configurable through an ini file. In this case I would avoid to rewrite the RT host VI when the setup and the FPGA VI are changed.

 

Kind regards,

Karsten

 

(Another way would be to use scan or hybrid mode with shared variables, but then it is not possible to have safety functions on the FPGA level.)

0 Kudos
Message 3 of 6
(3,396 Views)

Hi Karsten,

 

The setup connected to the cRIO will be changed from time to time but it will always consist of the same types of components (mainly valves, pumps and heaters). My thought is to have standard labels of controls in the FPGA VI (like Valve[i], Pump[j], Heater[k]) and to have the RT part configurable through an ini file.

Yes, that's the way to go. Create a FPGA VI maintaining "generic" I/Os with names like DigOut0…n or AnalogIn0…n. Which I/O pin is used for which hardware device is handled mainly in the RT part using a lookup table or any other algorithm you like to use. I do that with all of my cRIO systems…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(3,392 Views)

The problem with trying to make FPGA code configurable is that FPGAs are hardware.  Everything must be set.  You can do some things with the FPGA interface to make it more generic, but you will also be limiting what you can do with them.

 

If you want truely generic code for your RT, then use a DMA FIFO to send commands down to your FPGA.  I typically use a U64 data type with bits packed in to represent the command and data.  The FPGA can then process the command however it needs to and react accordingly.  You can do something similar for the data reading.


GCentral
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 5 of 6
(3,387 Views)

Thanks to both of you. Good to know that there is no real option which I just was not aware of. Probably I will end up with some case structure in the RT host VI.

 

Regards,

Karsten

0 Kudos
Message 6 of 6
(3,380 Views)