Settings -> Program Events -> Program Pause/Resume

This Program Pause macro seems to be a new feature in gSender.

When the Program Pause is empty or disabled, and you hit Pause Job during a job, the machine will stop right away on the spot (which is supposed to be like this)
However, if I put some code in it (e.g. G53 G0 Z-0.039 ;retract to top), the machine will not stop right away. It will only stop until it finishing running the current line.

Or is there any sample code for using this event?

This is by design and should (or will be) part of the documentation. Standard pause issues a feed hold which pauses movement immediately even if there are movements planned - those movements will happen once the hold is resumed. Feed hold prevents further g-code commands from being executed, which also means that gSender cannot inject any code.

Pause events stop sending on the software side (sender hold) so no further lines are sent but that also means than any planned movements already in the buffer complete - it’s something that can’t be avoided on the firmware side and this is a compromise to be able to execute code at all.

Other firmware’s have ways to handle pause code execution - but for now this will have to do for anyone who wants to execute code on pauses.

1 Like

One issued I’ve noticed in the Program Resume Event.
If there is an M0 command in the Program Start event, when I click resume from this M0 command, it will trigger the macro in the Program Resume Event, which doesn’t seem correct to me.

So these following behaviors are working as a user would expect:

  • The M0 command in the Program Start Event won’t trigger the macro in the Program Pause Event.
  • And the M0 command in the Program End Event won’t trigger the macros in Program Pause or Program Resume Event.

But this is not expected:

  • The M0 command in the Program Start Event will trigger the macro in the Program Resume Event.