LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to catch value of an indicator and use it somewhere else?

hey there, can anybody give me the name of any particular function that can catch a numeric value of an indicator and pass it to another indicator I'm using case structure and I want to get the value of a variable when the case is true and further use it when the case is false.

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

Easiest would be to attach your code so we understand the definition of your terms, "catch" and "variable", for example. Also explain in more general terms what the program should do. Maybe you are looking in the wrong place for a solution. Why do you need two indicators for the same value? Seems redundant.

 

An indicator is for the UI which just blindly display whatever is in the wire going to it. In LabVIEW, "the wire is the variable" (simplified). An indicator is a data sink. To use the "value" you need a data source. So if you want the value in two different indicators, just branch the wire.

 

To hold data between iterations, we typically keep the wire in a shift register so all cases have access to the value.

 

Please attach your VI and explain what it should do. What is the function of the case structure?

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

This sounds like a job for a local variable.  If you right click the second indicator's terminal and create a local variable, you can set the local to be writeable and then wire that into first indicator.  That way, whenever the first indicator is written to, the second one will also be

 

But yes, showing us the code you have so far would be helpful to make sure we're understanding what you need

 

Senior Software Development Engineer
Certified LabVIEW Architect and LabVIEW Champion
https://theLonelyAnt.com
https://GDevConANZ.org.au


Message 3 of 5
(2,757 Views)

@Engr.Asfand wrote:

hey there, can anybody give me the name of any particular function that can catch a numeric value of an indicator and pass it to another indicator I'm using case structure and I want to get the value of a variable when the case is true and further use it when the case is false.


A variable in LabVIEW is a wire.

 

Although you can get a control's value with it's terminal, a local or a value property node, the value preferably is a wire in your application, and that variable can be used in your case structure... 

 

wiebeCARYA_0-1673429467312.png

The wire solution will have the least strings (pun intended) attached... It has the least room for race conditions, and results in the easiest code. Getting data from controls can't be avoided completely though.

0 Kudos
Message 4 of 5
(2,748 Views)

@Engr.Asfand wrote:

hey there, can anybody give me the name of any particular function that can catch a numeric value of an indicator and pass it to another indicator I'm using case structure and I want to get the value of a variable when the case is true and further use it when the case is false.


Reuse the wire you used to write to the indicator in the first place.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 5
(2,737 Views)