LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to send successive values from inside a sequence to a single external indicator

Hello,

My problem is the following : I've a indicator outside of a sequence.
In each frame I calculate a value that I would like to display the value on the indicator that is outside of the sequence.
I don't see how to do that as I cannot connect multiple wire to the indicator.
Any solution is welcome.
(I guess solution may be easy but I'm beginning with labview and only has experience with C...)

Emmanuel
0 Kudos
Message 1 of 4
(2,736 Views)
You can write to a local variable of the indicator.

Many times, the code can be rewritten in a way where local variables are not needed. For example you could use a state machine architecture in a while loop where each case represents one of your sequence frames. You could then put your indicator to the right of the case structure where it would get data from each section in sequence. Please attach a copy of your code, and maybe somebody can come up with some improvements.

Message Edited by altenbach on 04-20-2005 11:26 AM

0 Kudos
Message 2 of 4
(2,736 Views)
Salutations,

Seems, this type of a question has already been answered. Granted, I don't know if they were using a sequence. But one person lists 4 different ways to pass data out of a sub vi. I'd imagine this is applicable to you.

http://forums.ni.com/ni/board/message?board.id=170&message.id=117307#M117307

Sincerely,
ElSmitho
0 Kudos
Message 3 of 4
(2,729 Views)
Hi Emmanuel,

What you're looking for is a quite simple solution. However, here’s first an explanation.

The reason that you can't update an indicator from every frame of a Sequence Structure is that the complete Sequence Structure has to finish before passing any data on to indicators outside the Sequence Structure. Therefore your indicator would have to be present in all of the frames that you wanted it to be updated in. The way to create multiple connections to an indicator or control in LabVIEW is most easily solved by using Local Variables.

Now Local Variables are not very efficient and should therefore never replace the Dataflow (wires directly to the indicator) if possible. Therefore if will be a better solution to create what's called a State Machine instead of the Sequence Structure. It's basically just a While Loop containing a Case Structure. The Case Structure should have a case for each of the frames in the original Sequence Structure. The job of the While Loop is to execute multiple of the cases in the Case Structure, so the most simple State Machine would be to wire the "Loop Iteration" node (small blue 'i') to the "Case Selector" terminal (green '?') of the Case Structure, and then have cases for '0', '1', '2', '3' etc. representing the number of frames from the Sequence Structure.

Here comes the reason why the State Machine in your case is BETTER than the Sequence Structure: You can place your indicator outside the Case Structure but within the While Loop and will therefore not have to create any Local Variables - mission accomplished!

Check the attached "SequenceVersusStateMachine.vi" for a demonstration on the two options.

Have fun!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 4 of 4
(2,707 Views)