Jump to content

Implementing an abort button to a sequence


Recommended Posts

I am trying to implement an abort button for my ladder program and am unable to get it to work. I have a program that runs a sequence of steps, and the last step sets a "Complete" bit, which resets a bunch of stuff and reverts the HMI to the home screen. 

I would like to implement an "Abort" mechanism, which would directly set the "Complete" bit, skipping to the end of the sequence, however if I do this the "Complete" bit never actually gets set, despite being wired directly from the abort contact.

Would anyone be able to suggest why this is happening? Thanks in advance for your help!

Here is the first rung in the program showing the abort bit activated failing to set the complete bit:

image.png.c4f7529b2ccd30760c98404e46542b6b.png

 

And here is the rung that is normally activated at the end of the sequence which I would like to activate via the abort bit

image.thumb.png.91763c63fe6050d05efa46d6d1f349a8.png

Link to comment
Share on other sites

  • MVP 2023

Your logic is turning Cleaning.Complete off immediately when it's on.  You'll never see it in the on state.  The computer screen updates much more slowly than the actual PLC logic.

I'd add a Reset to the Cleaning.Complete rung to also reset the State.Abort bit to prove that it's working.

While you're browsing around on the forum, search up my posts on the State Machine programming style in the Visilogic forum.  It applies equally to UniStream.  It will do what you're trying to do in a much cleaner fashion.

Joe T.

Link to comment
Share on other sites

Hi Joe,

Thanks for your help! I found your example here and have implemented a similar thing in my code which greatly simplifies it and works great. 

For any future readers, I now store the state in an integer and the abort button simply changes the state to idle. 

Thanks again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...