Conditional gcode help required - New Problem
-
OK. So by a process of elimination, I have found the reason (but not the cause) for the errors and a work around. I created a gcode file with simply the start part and the end part of a print file which provokes the problem. That is to say, with all the G1 moves removed. Running that did provoke the problem. Then I progressively removed various commands until I ended with simply this:
M98 P"0:/macros/PrePrintPETG.g" ;G21 ; set units to millimeters ;G90 ; use absolute coordinates ;M83 ; use relative distances for e M107 M98 P"0:/macros/PostPrint.g"
..........and that will provoke the problem when run as a print file. Yet running those commands "stand alone" via the console does not provoke the problem - it has to be done as a print from the sd card.
The work around is to put M400 before that second "post print" macro (or indeed at the start of that macro before the call to the second "tool temps" macro).
If that's how it has to be, that's fine by me, but I suggest it be documented somewhere so as to help others in the future.
HTH
-
Thanks, that will make it easier for me to track down.
-
@dc42 said in Conditional gcode help required - New Problem:
Thanks, that will make it easier for me to track down.
No worries. I have those macros in a folder on my google drive so I can send you a shareable link if you want to replicate things exactly.
-
Thanks, I've reproduced the fault using those files, and I'm looking into it.
-
I've worked out what's going on. The G10 command would normally be synchronised to the movement queue. If there are movements not yet complete, it is put in the deferred execution queue. When it is retrieved from that queue, the "iterations" context has been lost.
I think the solution will be to substitute for all { } parameters when copying the GCode command to the deferred execution queue.