peter_hf Posted May 8 Report Share Posted May 8 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: 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 Quote Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted May 8 MVP 2023 Report Share Posted May 8 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. Quote Link to comment Share on other sites More sharing options...
peter_hf Posted May 9 Author Report Share Posted May 9 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. Quote Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted May 9 MVP 2023 Report Share Posted May 9 I'm always looking for this and decided it should be Pinned. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.