LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global VI on low level does not change indicator on Front Panel

Solved!
Go to solution

I've assigned a global variable (CMM_SN_Global 3.vi) to a value in a subVI two levels down from the Front Panel. When I run the Front Panel VI an indicator which is set by the global does not change even though the global variable is assigned the correct value until later on in the program. Shouldn't an indicator on the front panel be assigned the value of the global as soon as the global is assigned a value. Or is that not true?

 

Thanks.

Chuck M.

0 Kudos
Message 1 of 5
(2,740 Views)

Hi Chuck,

 

the first that I see when opening your attached vi is the classic RubeGoldberg: if TRUE then TRUE else FALSE Smiley WinkAnd this RG several times in different locations... Add some unneeded local variables, duplcate code instead of subvis - you should think about redesign the whole thing!

 

Ok, what do you mean by "assign a global to an indicator"? In LabView globals are NOT assigned to anything, they work as "variable" known from text based programming languages. You write a value to a global and in different place you read the value.

When you write a value to a global then there will be no "magic" involved to display that value on any indicator on any vi front panel. You have to read the value again and write to the indicator in question!

Message Edited by GerdW on 10-25-2009 07:18 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,731 Views)

Thank you for the help on globals, I was able to fix that problem with your help. It's your first paragraph I dont understand.  Could you explain. Why do you think I should redesign what I've done, and what approach should I take. What I've done so far is just the start. My plan is to have ten independent loops just like the top one running a burnin stations, where each burnin is about four days.

"

the first that I see when opening your attached vi is the classic RubeGoldberg: if TRUE then TRUE else FALSE :smileywink:And this RG several times in different locations... Add some unneeded local variables, duplcate code instead of subvis - you should think about redesign the whole thing!

 

"

 

 

0 Kudos
Message 3 of 5
(2,726 Views)
Solution
Accepted by chuck72352

Hi Chuck,

 

so you asked for examples:

RubeG.png

What do we have here:

- the select node with those 3 boolean constants is really nonsense (aka RubeGoldberg) as the output is always TRUE!

- the "position" indicator belongs outside the case statement as all cases write to that indicator ("unneeded locals"!)

- why is there an additional wait inside the case? Do you really need that as you also wait in the while loop?

- it is not recommended to compare floats for equality - as you do here with your case structure when you wire a DBL to the selector input. Why not convert the data itself to integer to be on the safe side?

 

Then you say: "My plan is to have ten independent loops just like the top one"

That's the reason to use subvis. You can have as many loops as you want, but only need to code the algorithm once ("duplicate code").

 

More comments on why I recommend some "redesign"?

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(2,721 Views)

Thanks for the suggestions. I've used them all. Any other comments are appreciated. This is only my second labview project.

 

 

0 Kudos
Message 5 of 5
(2,703 Views)