-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protocol_enqueue_gcode does not set last_error #488
Comments
Yes, commands coming that way should be from tested code - it should not (and can not) be used to stream general gcode.
What was tricky? |
You are right, I'm using it for hard-coded correct commands, but is it impossible that command will fail because of some reason in grbl module - some state caused by previously executed commands?
For example, from macros.c file:
if another plugin hooks stream later, but will behave like proxy - pass data to previous stream function, on next call macros plugin will hook stream twice. |
IIRC not possible, if a command leaves the machine in a state that will cause the next to fail it will raise an alarm. Hmm, when I think about it perhaps protocol_enqueue_gcode() should not accept gcode if last_error is set?
It is for single commands (or blocks) - if you want to execute a number of commands then it is, again IMO, better to temporarily claim the input stream in order to ensure that they are not mingled with unwanted commands. |
Hello Terje,
Was it intended to not set last_error in case of extra command handling - initiated from protocol_enqueue_gcode?
I've fixed it this way:
I'm working on my lathe panel plugin, and found that it is not possible to track command execution result. I started from hook hal stream, but found this way a bit tricky in case of multiple hooks from another plugins. So I decided to use protocol_enqueue_gcode, but didn't find a way to handle its result without proposed change.
The text was updated successfully, but these errors were encountered: