01-08-2023 09:33 AM
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.
01-08-2023 09:54 AM - edited 01-08-2023 10:01 AM
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?
01-11-2023 02:14 AM
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
01-11-2023 03:34 AM - edited 01-11-2023 03:38 AM
@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...
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.
01-11-2023 05:22 AM
@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.