Jump to content

Stopping Case Structure Execusion


Paul

Recommended Posts

I have a button wired to a case structure. The button is inside a while loop that runs until the button is pushed. When the button is pushed it sends a true command to the case structure that then executes a series of long and complicated commands. What I want to do is wire another button that would stop the case structure from continuing to execute as soon as the user clicks on the second button. I have tried several different ways to do this with no apprent luck. In a nutt shell I am looking for a user control that would stop a case structure in the middle of execution. As always, all ideas are welcome.

Link to comment
What I want to do is wire another button that would stop the case structure from continuing to execute as soon as the user clicks on the second button. I have tried several different ways to do this with no apprent luck. In a nutt shell I am looking for a user control that would stop a case structure in the middle of execution.

1155[/snapback]

You cannot abort a process this way because you have not programmed any modularity in your code. The only way to do this is to put case structures around the bits of code that you need to abort and then make those cases false when you hit stop. For example, if you have three VI's that have to execute and you are executing VI#1 then you can ignore VI#2 and #3. However you cannot abort VI#1 until it has finished executing. If you need this type of control I recommend using state machine architecture and break down your code into smaller chunks that can be controlled better.

Here is the FAQ entry:

What is a State Machine

If you want to do simple start and stop button behavior, look at the attached example (LV70)

Download File:post-2-1089822983.vi

Link to comment

Mr. Aivialotis,

This is the third time that you have saved my behind. Many thanks, beyond expression. I guess Greeks and Russians can relate to one another best. Thanks again for all of your help and no offense inteded but hopefully I wont be needing it again. I am almost done with this particular program, and hopefully I can finish it up without any additional help.

Thank you so much.

Paul

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.