Example Code

FPGA: How to Update the Main VI While a Sub VI is Still Running

Code and Documents

Attachment

Overview
This examples shows how to use Global Variables within an FPGA target.

 


Description
This examples shows how to use Global Variables within an FPGA target. Global Variables can be used to pass information into and out of a loop during execution. Here, this VI use Global Variables to transfer different signals. On the one hand, pass values to the main VI before a subVI finishes executing. On the other hand, pass a value from the stop button into a while loop of the subVI so that the loop inside it will stop. These can also be used to stop infinite loops because the values do not have to be passed in at the initialization of the loop.

 


Requirements

  • LabVIEW 2012 (or compatible)
  • NI-RIO Device Drivers 2012 (or compatible)
  • LabVIEW 2012 FPGA Module (or compatible)


Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the "Update Main from Sub 2012 NIVerified.lvproj"
  3. Open the VI "Main FPGA.vi"
  4. Run the program

 

Additional Information or References
VI Snippet of "Main FPGA.vi"

 Block Diagram.PNG

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Jacob K

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.