LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a periodic task (T = 30 mins) and still have the interface responsive?

Solved!
Go to solution

Hi.

 

I created an application that drives a stepper following a certain rule every few minutes. The problem is I cannot stop the program before it finishes since the respective iteration still needs the delay to timeout.

 

I used two approaches, namely a "Wait" block  and a Timeout included in a case structure. Either way, I had to wait for the time interval to pass in order to press the "Stop" button.

 

Is there an easy way to fire a periodic task (or alarm)?

 

Thanks.

0 Kudos
Message 1 of 7
(2,709 Views)

It would be good if you can show the code what you have done as a snippet ot the vi (2009 version please)

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 7
(2,706 Views)

Thanks for your reply.

 

Can you give me some pointers regarding alternative methods to the two that I already wrote about? I'd like to try them first and then I'll post my code. I do this mostly because my script is very "spaghetti"-like and cleaning it up will take me some time.

 

All that I need is just the principle of the method no matter how generic it is.

 

 

0 Kudos
Message 3 of 7
(2,703 Views)
Solution
Accepted by topic author anarchix

Why don't you use the Elapsed Time function?

0 Kudos
Message 4 of 7
(2,699 Views)

Already tried it. I must have set the wrong paramaters because I never got it working. My stepper is suppose to finish doing its thing in max 15 secs. I suspect that I set the wrong interval in the block and mistakenly assumed that the secquence was never executed -> my mistake was that for testing purposes I set the Elapsed Time interval to 10-30 seconds to make the tests faster.

 

I'll post un update as soon as I'll test my code.

 

Thanks a lot.

0 Kudos
Message 5 of 7
(2,695 Views)

What is the delay time you are giving?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 6 of 7
(2,693 Views)

It seems that I wasn't running Elapsed Time in a loop. Now everything runs fine.

 

Thank you.

0 Kudos
Message 7 of 7
(2,663 Views)