LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continously Calling variables from a subVI to a higher VI

Hi Everyone,
 
First, I have a subVI that calls a device with certain conditions and then displays the devices graph onto the subVI continously. Now I want to call the subVI's graph at a higher VI location and I would like the graph to refresh every time it is changed through the subVI. Currently the higher VI only calls the subVI once and then never again. I have tried putting it in a while loop and hoping the variable would update but with no luck. I have also tried calling putting the graph as a global variable but Im not quite sure that I did that correctly because Im not sure on how to declare global variables properly in LabView, but either way the way I tried didnt work. If anyone could help I would be most appreciative.
 
Thank you,
Ben White
0 Kudos
Message 1 of 2
(2,560 Views)
Ben,
So this is a great architectural type question that can be solved in a number of ways. The first and most fragile would be to use a global variable. However, this is a great way to run into race conditions as well as duplicate data (what happens if you read the variable twice before you write to it?). I think one of the best ways to do what you're looking for is to use a Produceer\Consumer Design Pattern (Data). LabVIEW comes with a number of templates for you to use and the Produceer\Consumer Design Pattern (Data) is one of those templeates. You can access the templates by going to File>New... then expand VI>>From Template>>Frameworks>>Design Patterns. This is a somewhat complex architecutre, but one that we discuss IN DEPTH in the LabVIEW Intermediate 1 course. Hope this helps out!
 
Chris C
0 Kudos
Message 2 of 2
(2,536 Views)