LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indicator Values from Multiple Points in a Program

Solved!
Go to solution

I may be requesting the impossible...

 

I have a program that is a three-frame stacked sequence. In each frame there are case structures, in which there are while loops. In the while loops, it reads off the temperature from a piece of equipment.

 

I would like to have one output on the front panel, "Temperature", which reads from the "Get Temperature.vi"s in each of the frames. See image below. Am I out of my freaking mind to be trying?help with labview.JPG

0 Kudos
Message 1 of 8
(3,442 Views)

You can create a local variable from that indicator and write to that in both loops which wouldn't be crazy.

 

A lot of times if you have two while loops in sequence that can be replaced by a single state machine that will remove the need to use local variables.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 8
(3,433 Views)

If I were to use a local variable, where would I put the indicator and the variable readout so that it updates in accordance with all of the loops?

0 Kudos
Message 3 of 8
(3,429 Views)
Solution
Accepted by urlmichael

You would feed the output of Get Temp.vi into the local variable.  You can use the indicator in place of one of the local variables but it doesn't matter where it is becuase local variables break dataflow.

Matt J | National Instruments | CLA
Message 4 of 8
(3,412 Views)

You need to re-think your code, too many beginner mistakes.

 

  • First of all, use a state machine as already suggested. No local variables needed.
  • If you need to get the temperature in the true and false case, place it outside the case structure. only one instance needed.
  • Once you have a state machine and want to get the temperature irrespective of state, place it outside the state case structure.
  • Simplify!

See how far you get....

0 Kudos
Message 5 of 8
(3,403 Views)

Neat! Thanks a ton!

0 Kudos
Message 6 of 8
(3,400 Views)

@urlmichael wrote:

Neat! Thanks a ton!


And here's the right way using a (very primitive) state machine... 😄

No sequences or local variables needed.

 

Message 7 of 8
(3,390 Views)

Thanks for your input!

 

The VI that I posted is not the VI that I'm working on. I just made the one that I posted to give the forums a graphical representation of the problem that I am working with.

 

I see how you formatted the VI - this is definitely the right way to do it if that were all that I wanted to do. However, there are a lot of other parts of my main VI that would not fit into this.

 

So Sadly I cannot really apply the code that you posted. However, I looked it over and I thank you because I am always trying to do things the most efficient way possible

 

Thank you!

0 Kudos
Message 8 of 8
(3,377 Views)