Using the Same Global Variable Across a Host PC and Real-Time Target

Updated Apr 8, 2019

Reported In

Software

  • LabVIEW
  • LabVIEW Real-Time Module

Issue Details

I have a global variable that I'd like to use in both my host PC and real-time target, how can I get changes to the front panel of this global to persist between the two?

Solution

Once you have created the global variable on the host PC, in the project explorer, go to the real-time target and right click, go to Add>>File and navigate to the global variable that you need to access across both systems as shown below:

   

This will allow you to have a Global Variable of the same type across multiple devices, and should be used mainly when reading from the variable as a constant as the value of the Global Variable will not persist between devices. 

Additional Information

Changing the value of this global on the RT target will not update the value on the host PC and vice versa. This cannot be used as a method of communicating between the host PC, RT, and FPGA. To do this, see RT FIFOsNetwork Shared Variables and Network Streams .