LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LED ON while doing a Sequence, then LED OFF - how?

I have a Sequence, that makes some stuff (takes about 10 sec). I want to indicate, that the Sequence is runnig, by an LED. How do I do that?
I could put the Sequence in a case-structure and the case-structure in a While-loop, that runs 2 times, a boolean variable in the while loop is set TRUE during 1st run and turns on the LED and triggers the case-structure and then set WRONG in 2nd run, an turns off the LED. BUT THATS COMPLEX!!! (And its not realy working yet)

I have LabVIEW 6.0 (!)
Johannes
Grundig
Germany
0 Kudos
Message 1 of 3
(3,821 Views)
try wiring a 'true' constant into the left side of your sequence. In the first frame, wire a property node with the value element(from your LED) to the 'true' constant. In the last sequence frame, wire a 'false' constant to the right side. On the outside of the sequence, wire the LED terminal to 'false' constant.
Message 2 of 3
(3,821 Views)
> I have a Sequence, that makes some stuff (takes about 10 sec). I want
> to indicate, that the Sequence is runnig, by an LED. How do I do that?
> I could put the Sequence in a case-structure and the case-structure in
> a While-loop, that runs 2 times, a boolean variable in the while loop
> is set TRUE during 1st run and turns on the LED and triggers the
> case-structure and then set WRONG in 2nd run, an turns off the LED.
> BUT THATS COMPLEX!!! (And its not realy working yet)
>

You have several ways to animate things while doing computation.

One technique is to keep your sequence, and create a local variable for
your Boolean that you want to animate. Put the local variable writes in
the frames where you want to change its state. I didn't completely

understand whether you wanted it to blink or what.

A different, and in my opinion, better approach would be to make a very
simple state machine. Popup on the sequence and replace it with a case
statement. Place a while loop around it and wire i to the ? terminal.
With no other changes, this will now execute your frames in sequence,
just like before, but you have the option to set the Boolean each
iteration of the loop, you can more easily have state info pass from
frame to frame, and any frame can abort the sequence by affecting the
loop's continuation terminal.

Still another approach, that affects your code less is to make a
completely parallel loop that does your animation at whatever rate you
want. It is really a state machine whose state is controlled by your
sequence frames. You change the state variable from hidden to first,
second, third, and so on. At the end of the sequence you set it back to
hidden.

Greg McKaskle
Message 3 of 3
(3,821 Views)