LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hello all, I need help please. What i am trying to do is i want to control the LEDs in the three different loops as shown in the attached vi using one switch only. Please help > Thanks in advance

(Please keep the subject line short and put your question in the body of the text. Thanks!)

 

You have a classic dataflow problem. Your switch terminal will only be read once at the start and never again. All your loops will spin once, wait for the time delay, then exit. Once all while loops have completed, the VI will end. What was the point?

 

  1. The loops need to iterate more than once, so don't wire a true to the conditional terminal
  2. The switch needs to be read at each iteration, so place it inside one of the loops.
  3. Place local variables of the switch inside the oter loops.

I am not sure what you are trying to achieve, but for this problem you would use a single loop and place the switch and all LEDs inside it. You should also use a shorter delay. With a 4s delay, it might take up to 4 seconds until the switch is read and the LEDs change.

Message 3 of 6
(2,909 Views)

Hi Besho,

 

instead of putting your whole question in the title of your thread you should have put more text in the message body.

Especially you need to explain where you have problems with your code…

 

What exactly do you want to achieve?

 

Right now you can control all three LEDs with this single button. But due to DATAFLOW the only settings that is applied is the button state at VI start…

Go through LabVIEW basics and learn to THINK DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,908 Views)

This is what i have done.What i wanted is the first led should blink then after 5 secondes the second led then after 10 second the third led . but i couldn't do that.

0 Kudos
Message 5 of 6
(2,883 Views)

@Besho wrote:

This is what i have done.What i wanted is the first led should blink then after 5 secondes the second led then after 10 second the third led . but i couldn't do that.



That is unfortunate!  It seams like an easy homwork problem attempting to thech you datagflow concepts.

 

And you are not thinking about dataflow when you place 3 while loops that run in parraell with copies of a mis-configured express vi in them.  Of Course there is no "Action"   As written the vi will delay 4 seconds (three times in parallel) and exit --returning nothing and outputting nothing.

 

Do take a training course


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(2,875 Views)