LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variables

Hi all
 
I am using a global variable to indicate the status (open or closed) or a solenoid valve as  the solenoid valve is being acted on at different stages of the data flow. However, although the led indicator on the Global front panel vi change when the solenoid is switched at various stages in the dataflow, I cannot get this Global panel vi led to display on the main process front panel. I am using the global vi to write to the main process front panel led indicator, however I seem to need a separate led indicator each time I read the  global vi value at each stage through the process data flow.
It would be ideal if I could display the one led indicator as in the global front panel
I am using one sub vi to switch the solenoid valve which writes the change of state to the global. This sub vi is used every time throughout the data flow which is why the global front panel led changes when required. But cannot mimic this global front panel led on the main process front panel.
I hope this makes sense as it is frustrating seeing the global front panel led changing when required but not able to get ONE LED indicator on my main process front panel to mimic this.
The LabVIEW help documents state that I can create a single global VIs each with one front panel object (i.e. the led indicator). I wonder if I could connect the global variable value to the selector terminal of a case structure where True (or open valve) would light the led in a subdiagram (case) and False would run another subdiagram .....
I hope someone has some bright ideas, its just too hot to suffer this problem.
TonyC
0 Kudos
Message 1 of 4
(3,028 Views)
It would probably have been better for you to pass a reference of the front panel Boolean so that everytime you switch the solenoid, you also write to the reference. I've attached a very simple example of using a reference. If you don't want to change your program much, then it sounds like you could just add a separate while loop that does nothing but read the global variable and write to the front panel Boolean.
Message 2 of 4
(3,023 Views)

Cheers Dennis

I have never used a reference before (never really knew what they did). But on your recommendation I will work through your code and the LabVIEW help to see if it is useful.

I will get back to you.

Ta

TonyC

0 Kudos
Message 3 of 4
(3,017 Views)

A great thanks to Dennis for his reply and suggestion. It got me out of a rut and thinking again.

After playing about with references it actually makes the data flow look a lot tidier.

Another trick for my log book.

Thanks Dennis

TonyC

 

0 Kudos
Message 4 of 4
(2,991 Views)