LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a pause feature to a state machine.

I am using the attached VI (Auto Reactor.vi) to control a sequence of relays on an NI 9481. What I have it set up to do right now is run several pre-defined cycles in a given sequence based on user-inputted time parameters for each. What I need to do is build in a pause function such that whatever cycle is currently being run pauses at the press of a button then resumes exactly where it was in the cycle when the button is pressed again.

There are several forums relating to this; however, I have not had any success using the techniques presented within them. Any help would be greatly appreciated.
0 Kudos
Message 1 of 7
(4,308 Views)
I forgot to mention that I am using LabView 8.0.
0 Kudos
Message 2 of 7
(4,307 Views)

Hi nick525,

you can add an additional "break" button and set the Event Timeout time to -1. After change back, the loop goes on.

I attached an example of it.

Mike

0 Kudos
Message 3 of 7
(4,291 Views)
This is definitely a good start, but when the button is pressed to resume, the cycle does not resume at the point at which it left off. Instead, it subtracts the time spent paused from the remainder of the cycle upon being pressed, and the cycle runs for this reduced amount of time. Is there any way to fix this using the same general method used in your example vi?
0 Kudos
Message 4 of 7
(4,255 Views)

Hi nick525,

if the break starts you can write the actual time in a shift register and if the break stops you calculate the break time. With this difference you can then calculate the correction, so that the rest of your program runs as it would do without a break.

Mike



Message Edited by MikeS81 on 02-11-2008 02:28 PM
0 Kudos
Message 5 of 7
(4,242 Views)
I have been trying to accomplish what you suggested, but just can't get it to work. To what should I apply the correction for the pause feature to function properly?
0 Kudos
Message 6 of 7
(4,221 Views)
I knew this would happen, because it always does, but I figured out my problem not 10 minutes after my last post. Thanks very much for helping me out!
0 Kudos
Message 7 of 7
(4,217 Views)