LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

put a delay for executing case structure

Hi, everybody.

 

I would like to ask a question. Currently, I have developed a while loop with a case structure inside the loop. I want to execute the case structure with 600ms delay once the case is true. Are there any way(s) for doing this without affecting the loop? If possible, can show me the way of doing this? Thank you very much.

 

Regards,

 yukfai88

0 Kudos
Message 1 of 5
(3,880 Views)

What do you mean by "not affecting the loop"?  If it takes 600 msec for the case structure to execute, then that particular iteration of the while loop is going to take 600 msec longer.

 

You can put the code in the true case in a flat sequence structure with a 600 msec wait in the first frame and the rest of the code to execute in the 2nd frame.

 

 

0 Kudos
Message 2 of 5
(3,874 Views)

Hi Yuk,

 

Not 100% sure what you are after here but i gave it a go for you. Im assuming that in your while loop you perform other tasks but you want a specific task to be triggered in a case structure after a certain amount of time (600ms) after a button has been triggered. I made a small subvi that you can put in line with your trigger and the case structure and wire a delay time to it. Hope this is what your after:

 

Delayed action.png

 

This is just a snippet of how i think you are wanting the code to look like. You can see the small subvi that i have entere in line with the boolean to the case structure. Let me know if this is not what you are after. Just for your info the actual subvi is this:

 

Delayed action Sub vi.png

 

As i said, not 100% sure this is what your after. Just want to clarify, the above subvi does not pause the main while loop, this will keep iterating so you can continue to action any other code you have in the while loop.

 

Regards,

 

Lucither

Message Edited by Lucither on 03-22-2010 06:10 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Download All
Message 3 of 5
(3,842 Views)

Thank you very much, Ravens Fan and Lucither. The advice helps a lot.

 

Regards,

 yukfai88

0 Kudos
Message 4 of 5
(3,817 Views)

The code is not working at all Smiley Indifferent

0 Kudos
Message 5 of 5
(3,361 Views)