LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Pause/continue a loop in Labview

So I think the problem is the code. The thing is: I didn't write that code. It was already here in the lab when I started here. And the professor asked me to add a pause button, but I find no way to do that with that code.. So I think I will have to write a new code with a pause button.

0 Kudos
Message 31 of 33
(218 Views)

First you need to figure out what "pause" actually means, what is it actually supposed to do.

 

Pause could mean stop your VI from proceeding further down a defined path until you unpause it.

Or since your VI seems to be a front end for issuing move commands to a motor controller, does it mean pause the motion of the controller, even if it is in the middle of a move command that was just issued.  (I can't tell what kinds of commands you send it because the subVI's are missing.)

 

The latter makes more sense, but is a much more complicated scenario.  And really does mean that VI should be completely rewritten.  Would you need to send some sort of stop move command to the motor controller.  At the minum, the pause functionality needs to be at the inner most while loop where the various steps are having and not on the top level while loop.  But even if you do that, you'll still have an issue with the event structure for the move button that locks the front panel.

 

Which still points to rewriting the entire VI.  Making it into a proper state machine.

0 Kudos
Message 32 of 33
(214 Views)

Thanks, guys, I tried in a different project with the state machine and it worked! Thanks for the help.

0 Kudos
Message 33 of 33
(206 Views)