Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Odd corner case bug with iterations

    Scheduled Pinned Locked Moved
    Gcode meta commands
    4
    8
    388
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mikeabuilderundefined
      mikeabuilder
      last edited by

      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.

      o_lampeundefined chrishammundefined 2 Replies Last reply Reply Quote 0
      • o_lampeundefined
        o_lampe @mikeabuilder
        last edited by

        @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?

        1 Reply Last reply Reply Quote 0
        • chrishammundefined
          chrishamm administrators @mikeabuilder
          last edited by

          @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.

          Duet software engineer

          1 Reply Last reply Reply Quote 0
          • mikeabuilderundefined
            mikeabuilder
            last edited by

            Sorry for not including my RRF version. I'm on 3.5 rc4. My hw is MB6HC

            dc42undefined 1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @mikeabuilder
              last edited by

              @mikeabuilder are you running in standalone mode or with SBC ?

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • mikeabuilderundefined
                mikeabuilder
                last edited by

                Stand-alone mode.

                1 Reply Last reply Reply Quote 0
                • mikeabuilderundefined
                  mikeabuilder
                  last edited by mikeabuilder

                  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

                  1. The file is run as a print job, then paused, then cancelled. (Note it runs properly to the end if not cancelled)
                  2. 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.

                  chrishammundefined 1 Reply Last reply Reply Quote 0
                  • chrishammundefined
                    chrishamm administrators @mikeabuilder
                    last edited by

                    @mikeabuilder Thanks, I could just identify another issue. We'll see if my upcoming change fixes your problem, too.

                    Duet software engineer

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Unless otherwise noted, all forum content is licensed under CC-BY-SA