Repository navigation
docs: say when on_abort is called and with which reason - #4875
Merged
Merged
Conversation
The example on_abort sub labelled reason 5 "machine on", 6 "machine off" and 7 "estopped". Task sends 5 on E-stop reset, 6 on an E-stop request and 7 when the machine is no longer on. Say that OFF and E-stop requests call on_abort even when the machine is already off or in E-stop, that a machine which was on gets a second call with reason 7, and which reasons an error that stops a program or MDI gives. The example now has a branch per reason saying what it means, and a second example shows a sub that skips the state requests and still cleans up when the machine goes off. Fixes LinuxCNC#4874
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The example
on_abortsub in the remap chapter labels reason 5 "machine on", 6 "machine off" and 7 "estopped". Task sends 5 on E-stop reset (the machine is still off), 6 on an E-stop request, and 7 when the machine is no longer on. Turning the machine on calls nothing.The chapter also does not say when
on_abortis called. OFF and E-stop requests call it even when the machine is already off or in E-stop, which is how a GUI triggers it at startup (#4874); a machine that was on gets a second call with reason 7; an error that stops a program or MDI leaves the machine on and brings no 7. I added that, gave each branch of the example a comment saying what the reason means, and added a short second example that skips 4, 5 and 6 and still cleans up when the machine goes off.I checked every reason with a sim config whose
on_abortprints#1, driven from a script, and ran both examples from the page as written:motion.enabledropped while on: 7Fixes #4874