LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do global variables work?

I have a vi that runs once to update a calibration factor. This factor is written to a file and then is read from that file into, I thought, a global variable. The display for that global variable is always zero, except in the vi display that created it.
0 Kudos
Message 1 of 2
(2,483 Views)
Global variables are used to read and write data between VIs in a single application. Because they violate the dataflow concept, they have to be used carefully and you need to watch out for race conditions. It's possible that the VI that reads from the file and writes to the global is not doing so. Another possibility is that the global display is happening before the global write. If you were to attach an application that demonstrates the problem, someone here could probably identify what's wronmg fairly quickly.
Message 2 of 2
(2,483 Views)