Can FPGA I/O Nodes Be Used in LabVIEW Object Oriented Programming?

Updated Oct 8, 2024

Reported In

Software

  • LabVIEW
  • LabVIEW FPGA Module

Issue Details

I am trying to access the I/O of my FPGA device dynamically through an FPGA I/O Node block. This block is placed inside a method VI of a class that is created under the FPGA target in a LabVIEW project. However, when I place the FPGA I/O Node block, LabVIEW forces me to configure it to a given I/O. I don't want to do this because I would like to access the I/O dynamically, meaning I will pass the FPGA I/O reference to the method VI so that it automatically configures FPGA I/O Node. Is this possible?

Solution

LabVIEW object-oriented programming (OOP) can be used to create code that is easier to maintain and modify without affecting other sections of code within the application. When combining this with the LabVIEW FPGA Module, a user can merge the benefits of LabVIEW OOP and the flexibility of the FPGA hardware approach. However, this combination has its limitations.

Dynamically defining the hardware configuration of an FPGA I/O Node through a class method is not possible. This is because the compiler must understand the hardware resources required before the compilation so that the FPGA design falls into the available resources in the FPGA chip. If the class method dynamically assigns hardware resources, the compiler cannot keep track of them, meaning the compilation won't be successful. 

If a user wants to do this, there are two potential workarounds that can be used. The first one is to create a class method for each hardware I/O that is needed. For example, a user could create an DO_HW_READ.vi that uses an FPGA I/O Node to access digital output resources of the FPGA. The tradeoff is that the class must include a method for each hardware resource required in the design. The other available method is to carry the FPGA I/O reference as a property of the class, and use it to configure a given FPGA I/O Node outside the class in the main code.