Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

FGV or Shared Variables

Hi,
 
I am about to start migrate my projects to Labview 8. I am kinda excited to see some of the communication limitations "disappear" from the horizon based on the hype. Is this true?
 
Also, I am using Functional Variables to move data between multiple threads in my RT code and share data. Will I get the same functionality using the Shared variables? The goal is to have multiple areas (loops) of my VI to have the same info.
 
Regards,
 
Ashm01 
0 Kudos
Message 1 of 2
(3,524 Views)
Hi There:

Shared Variables can definitely be used to transfer data between RT threads. In RT you need to make sure that the data transfer method you use is non blocking to avoid priority inversions. Refer to the following excerpt:

In order to maintain the deterministic execution of the determinisitic loop it must not contain anything that could be a shared resource of the non-determinstic loop such as a global variable or LabVIEW queue. The non-deterministic loop accessing the shared resource would block the execution of the deterministic loop when it attempted to access that resource. The RT FIFO features of the Shared Variable, as well as the RT FIFO VIs, provide a non-blocking means of data transfer.


Shared variables and RT FIFOs are both non blocking data transfer methods while functional variables are blocking. Here is another document that talks about advantages of FGVs Vs. FIFOs (which include shared variables):
http://zone.ni.com/devzone/conceptd.nsf/webmain/f1fc2b8d7f5a0532862568eb0079d30d
0 Kudos
Message 2 of 2
(3,509 Views)