LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to design two timed loop

hi,

    I want to design a two timed loop, one is to display the time every 1 second, the other one is to display the number of from 0 to 5 every 0.5s. I used time event for the first part and a "for loop" for the second part. But it doesn't work well. Please tell me what's wrong with it.

 

 

Thanks

 

Jessie

0 Kudos
Message 1 of 4
(2,785 Views)

Your For loop takes 3 seconds to run.  The event structure runs with the 1 second timeout.  The loop doesn't iterate until all code inside of it is done, meaning it will take 3 seconds.

 

Also, put a stop button control to stop the loop instead of having an infinite loop with the False constant on the Loop terminal.

0 Kudos
Message 2 of 4
(2,783 Views)

I noticed the problem that only after the loop ends can time event take action . However, I have no idea how to realize two timed loop. Can you give me some suggestion ?I appreciate your words.

 

Jessie

0 Kudos
Message 3 of 4
(2,759 Views)
Put the event structure in its own while loop.  Then they will run independently.
Message 4 of 4
(2,756 Views)