Odd corner case bug with iterations
-
I'm writing a macro to test some new code I'm putting into start.g. The macro is launched from the Jobs tab in DWC. The complete macro is this:
while iterations <10 m291 S0 P{"Waiting for 10 seconds per iteration. On iteration: "^iterations} g4 s10
If I start this "print" job, I see the messages start to print.
The bug happens when I use DWC to pause the job, then cancel the job, then start the job again. When I do this, the variable iterations is not reset when the job starts the second time. Seems like it should happen as part of the cancel process.
-
@mikeabuilder Can you please add more info about your RRF version? It looks like a bug, especially because AFAIK we can't set 'iterations' to zero ourselfs.
Does it also happen when you use a global variable instead of iterations?
-
@mikeabuilder I believe I already fixed the underlying bug in the upcoming RRF 3.5-b4. I cannot reproduce this problem on my test setup in standalone or SBC mode with the latest RRF dev build.
-
Sorry for not including my RRF version. I'm on 3.5 rc4. My hw is MB6HC
-
@mikeabuilder are you running in standalone mode or with SBC ?
-
Stand-alone mode.
-
Some additional information. I wrote the following in response to @o_lampe's suggestion, though I used a local variable and not a global.
var loops = 0 while var.loops < 10 m291 S0 P{"Waiting for 10 seconds per iteration. On iteration: "^var.loops} g4 s10 set var.loops = var.loops +1
In this case, the symptom is a little different. The repro steps are
- The file is run as a print job, then paused, then cancelled. (Note it runs properly to the end if not cancelled)
- The file is run a second time (either Print Again button in DWC Status page, or started from the Jobs page of DWC)
During the second run, the following error is produced:
M32 "0:/gcodes/loop test3.gcode" File 0:/gcodes/loop test3.gcode selected for printing Error: in GCode file line 3 column 17: meta command: unknown variable 'loops' Cancelled printing file 0:/gcodes/loop test3.gcode, print time was 0h 0m
If the file is run a third time, it runs properly. I assume that the RRF error handler properly cleared out whatever was amiss after the Pause/Cancel process.
-
@mikeabuilder Thanks, I could just identify another issue. We'll see if my upcoming change fixes your problem, too.