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 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. 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. 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now