@OwenD said in How to report current/last position and move on event:
Much of what you want is stored when a print is paused in resurrect.g, so you don't need to worry about it from a resume point of view
Wait... I confused myself.
resurrect.g has it, but I could not find any confirmation that it is created when pause.g runs. It is rather related to the power fail case.
I don't know what g-commands are executed when the pause button is pressed in PanelDue (allegedly, everything in RRF happens via g-commands). I looked at pause.g and it only does retracting and repositioning, that means it does not have any command to actually stop the print job or save any information.
In pause.g I read: "called when a print job is paused". That means that just calling pause.g is a step after actual pausing and will not by itself save the current position or anything else. So pausing a print job is one thing, running pause.g is another.
But looking at resume.g, I found following line:
G1 R1 X0 Y0 ; go back to the last print move
which means that at pausing a print job, the current position is stored to a restore point #n. And how does that position get stored there? Using "G60: Save current position to slot". I infer that G60 is used in some other macro file when the print job is paused.
In the description of G60 I read that
"When a print is paused the coordinates are saved to slot 1 automatically"
but I still don't know where this saving is disposed.
My question is now, what is the g-command or macro file to run in order to pause a print job (the same way as pressing the pause button on the PanelDue)?
Of course I can do handycrafts to save the current position and take all necessary precautions when a motor skip steps, but I would prefer using proven "built-in" methods.
Your turn.