macros wishlist
-
If I understand correctly, you want to call macro a certain time after a tool change event.
Have you looked at the G4 pause command? It does of course mean that the machine would sit idle during the pause but you could use that in tool change macro.
Or do you want to be able to have a macro called automatically some time after an event while continuing other tasks in the mean time? Effectively acting as a timed interrupt? This of course would be very problematic because there could be serious consequences depending on what processes were running at the time of the interrupt.
Edit. It would probably be better if you explain exactly what it is that you want to achieve.
-
@deckingman said in macros wishlist:
Or do you want to be able to have a macro called automatically some time after an event while continuing other tasks in the mean time? Effectively acting as a timed interrupt? This of course would be very problematic because there could be serious consequences depending on what processes were running at the time of the interrupt.
Edit. It would probably be better if you explain exactly what it is that you want to achieve.Automatically, of course. You can manually insert the code in any editor, but the whole essence of 3d printing is in automation.
I do not see a problem in the macro call. If a macro call is simply inserted into a ready-made g-code, is it called without problems?
The motion queue is important, and it is clear that the macro will not be called at exactly 10,000 seconds.A typical macro that I would like to call is 3-4 movement commands in absolute coordinates, to the nozzle cleaning device of excess plastic, and, possibly, the retract command for the active nozzle, to avoid plastic loss at the time of cleaning.
-
That would be possible to do. But wouldn't if be better to synchronise it to e.g. a layer change? If the print is interrupted in the middle of printing a curved outer perimeter, then it's likely that a small blemish would result.
-
@anidal said in macros wishlist:
Automatically, of course. You can manually insert the code in any editor, but the whole essence of 3d printing is in automation.......................
Sorry but I didn't expect to get into an argument when I simply asked a question. Best of luck............
-
@dc42 said in macros wishlist:
That would be possible to do. But wouldn't if be better to synchronise it to e.g. a layer change? If the print is interrupted in the middle of printing a curved outer perimeter, then it's likely that a small blemish would result.
Layer change and tool change can be separated by minutes. And the macro call will be late.
-
@deckingman said in macros wishlist:
Sorry but I didn't expect to get into an argument when I simply asked a question.
What a dispute, a detailed answer to the question - does not mean a dispute.
-
@anidal said in macros wishlist:
@dc42 said in macros wishlist:
That would be possible to do. But wouldn't if be better to synchronise it to e.g. a layer change? If the print is interrupted in the middle of printing a curved outer perimeter, then it's likely that a small blemish would result.
Layer change and tool change can be separated by minutes. And the macro call will be late.
Why is it particularly after a tool change (but not immediately after) that you want to do the nozzle cleaning? If you need to prime and clean the nozzle, that can be done in the tpost file. If you want to clean the nozzle at intervals, that can be done in the layer change script - unless you want to do it more often than that.
-
@anidal said in macros wishlist:
Ок, I try to test M0 function.
@dc42 said in macros wishlist:
File cancel.g is only called (instead of stop.g) if M0 is issued while the print is paused.
Good day!
I checked the behavior of the M0 function and the macro stop.g
At a regular print end, stop.g is called if it exists. The behavior is correct.
But now when you stop printing, the same stop.g is also called! this behavior is completely wrong.
Event completion of printing and manual stop are 2 different events.
If you manually stop the printer, you do not need to turn off the printer, and upon completion of printing it may be required.Please add a macro end.g to finish printing.
-
To stop a print manually, use Pause then Cancel.
-
@dc42 said in macros wishlist:
To stop a print manually, use Pause then Cancel.
yes,i do it and stop.g engaged! Not a cancel.g! it is mistake, i think.
-
Can you confirm that cancel.g exists?
-
-
@phaedrux said in macros wishlist:
Can you confirm that cancel.g exists?
if cancel.g exist - run cancel.g
if cancel.g not exsist - run stop.gIs it any docymentation about this hidden behavior?
-
@anidal said in macros wishlist:
@phaedrux said in macros wishlist:
Can you confirm that cancel.g exists?
if cancel.g exist - run cancel.g
if cancel.g not exsist - run stop.gIs it any docymentation about this hidden behavior?
https://duet3d.dozuki.com/Wiki/Macros#Section_Pause_stop_and_power_fail
Pause, stop and power fail
pause.g is run when you pause a print.
resume.g is run when you resume a print.
cancel.g is optional, but if present is run when you cancel a paused print.
stop.g is optional, but if present is run when a print finishes normally with an M0 command at the end of the print job.
sleep.g If M1 is issued the firmware finishes any moves left in its buffer, then shuts down, the macro file sleep.g is run before all heaters and drives are turned off.https://duet3d.dozuki.com/Wiki/Gcode#Section_M0_Stop_or_Unconditional_stop
The firmware finishes any moves left in its buffer, then it executes the macro file cancel.g if present, if the axes are homed and if a print is being cancelled. Otherwise stop.g is run before all motors are put into idle mode. If no H1 parameter is present, the heaters are turned off too. See also M1, M112.
-
@phaedrux said in macros wishlist:
The firmware finishes any moves left in its buffer, then it executes the macro file cancel.g if present, if the axes are homed and if a print is being cancelled. Otherwise stop.g is run before all motors are put into idle mode. If no H1 parameter is present, the heaters are turned off too. See also M1, M112.
More new! That is, if you set M0 at the end of the file, then do macros execute cancel.g and stop.g?
At the same time, cancel.g is called when a manual stop occurs, and if not, then stop.g is called?
Why such a complicated macro call system? If one is not, then we call another, etc. And the conditions for calling one and those macros overlap. Isn't it easier for each event to single out 1, the only macro that is called only by it? -
M0 causes stop.g to run; except that if the print is paused at the time, it runs cancel.g (if it exists) in preferences to stop.g.