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

    Need some guidance on pausing a macro until I provide input

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    3
    150
    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.
    • Phrayzurundefined
      Phrayzur
      last edited by

      I've got to be missing something. I'm trying to run the following example code:

      G1 H2 X30 Y30 F6000

      ; insert macro pause here
      M25

      G1 H2 X50 Y50 F6000

      However, it always returns "Error: Cannot pause print, because no file is being printed!"

      I'm not printing anything. I'm just putting a macro together to level my bed and need to pause so I can check the bed height. After I've done that I'd like to continue the macro by clicking resume (or something similar). I've tried M226 as well and, although I didn't receive an error, it didn't have any effect. I'm unable to use G4 because I don't know the duration of the pause.

      Any guidance would be appreciated.

      1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD
        last edited by OwenD

        M25 is only for use during a print.
        I suggest you use M291 in blocking mode (>S3)
        https://docs.duet3d.com/User_manual/Reference/Gcodes#m291-display-message-and-optionally-wait-for-response

        M291 R"Wait" P"Check bed height.  Press OK to continue" K{"OK","Abort"} S4
        if (input == 1)
            echo " cancelled"
            M99
        
        Phrayzurundefined 1 Reply Last reply Reply Quote 0
        • Phrayzurundefined
          Phrayzur @OwenD
          last edited by

          @OwenD said in Need some guidance on pausing a macro until I provide input:

          M291 R"Wait" P"Check bed height. Press OK to continue" K{"OK","Abort"} S4if (input == 1) echo " cancelled" M99

          Thanks so much! I'm using firmware version 3.46 (I'm not aware if 3.5 is stable enough), so I had to change it a little bit. I couldn't go higher than S3 and it wouldn't accept the "input" value. I ended up using the following:

          G1 H2 X30 Y30 F6000

          M291 R"Wait" P"This is a pause. Press OK to continue" K{"OK","Abort"} S3

          G1 H2 X50 Y50 F6000

          This works great so far! Thank you again!

          1 Reply Last reply Reply Quote 0
          • Phrayzurundefined Phrayzur marked this topic as a question
          • Phrayzurundefined Phrayzur has marked this topic as solved
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA