LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pause

Dear forum members. I attached a Vi. How can i control here Run/Pause button? For example i push Run 5min work and after automatically pause, and after push run and repeat same process. How can i add here Run time control?
 
Thanks in advance
With warm regards
Harutyun Melikyan!
0 Kudos
Message 1 of 4
(2,866 Views)

First you must move the Wait(ms) function at the outside loop. When case is false you use 100% cpu.

At the timing palete you will find the functions for controling timing issues. Use the tick count function , or the get time-date to read the current time and compare it with the time your application started. Then use a local variable to reset the boolean button.

0 Kudos
Message 2 of 4
(2,842 Views)
A lot of things make very little sense.
  • Your inner loop has no function. You can delete it without any change in functionality.
  • If Run/Pause is TRUE, you are opening a new file in replace mode every 300ms, never closing the old reference.
  • You are building an aray of potentially infinite size in a shift register, and writing an evergrowing array to a new file.
  • A better way would be to open the file once and append only the new data. This is much less work.
  • As mentioned, your FALSE case also needs a wait.

 

Here's a quick draft, see if you can adapt it for your tasks. It uses an event structure to only spin the loop if needed.

It will stop adding data after 10 seconds.

Message 3 of 4
(2,828 Views)

Thank you for your great help. This is the best way to solve my problem.

With warm regards

Harutyun Melikyan!

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