Where do I have to put the script file?
Where do I have to put the script file?
In the scripts folder in your profile. Name it M910.gcode
And the print statements are just in there to assist with debugging and can be removed once you have things working. The output shows up in the output window if you have it visible. Click on the icon with the two recangles up the top right to show/hide it.
Thanks, it works. I learned a lot.
The problem is, however, when the machine is processing code, the button cannot be used.
It should behave like the spindle start button.
I am not near my machine and it is to cold to go out to the shed, so I can't test this, but try adding enable="true" as an option in BtnTop.txt. You can conditionally control when the button is enabled, maybe the default is for it to only be enabled when idle.
Actually I don't think that will work. Once you are running code you can't use the buttons. You can't use the spindle button to stop the spindle while it is actively processing code.
You can however add M910 inside the code so that it happens as part of it.
In fact the enable option should probably be set to
so that the button gets greyed out when not usable. The orange highlight still shows, just like the spindle button when code is running.Code:enable="AND(_hw_idle == 1,_hw_estop == 0)"
it does not work because you can not execute g-code while machine is running.
But it is possible to do exact same thing without using g-code. I'll create an example.