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

    Restore original workplace number at the end of a macro?

    Scheduled Pinned Locked Moved
    CNC
    3
    3
    439
    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.
    • dc42undefined
      dc42 administrators
      last edited by dc42

      Currently, when you run a macro (or use the M120/M121 push/pop commands), certain values (e.g. feed rate) are saved at the start and restored at the end. Currently this does not include the current workplace number.

      Do you think the current workplace number (selected by G54, G55 etc.) should be saved and restored too? On the plus side, you would be able to reserve certain workplace coordinate numbers for use by particular macros, knowing that at the end of the macro you would be back in the original workplace number. On the minus side, you would not be able to have a macro that switches to a different workplace number and leaves the system in that workplace when you exit the macro.

      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
      • Danalundefined
        Danal
        last edited by

        Subroutines and Macros are not mentioned in the NIST G-Code standard, so no help there. Quite a few manufactures added M codes or G96 to achieve either subroutines or macros (with arguments) and returns. Nesting is allowed.

        To my knowledge, none of the proprietary M or G codes push/pop anything.

        .

        My personal feeling is that NOTHING should be pushed/popped "automatically" in a macro. M120/M121 can (could) be used in macros if that behavior is desired.

        To be clear, I'm not advocating changing existing behavior, too much of an install base... although, if you'd even consider that (non-upward-compatible) change, I believe it would improve the long term health of Duet/RepRap.

        Anyway, based on the de-facto handling in manufacturers extensions, and on my personal philosophy, I'd vote no to auto-push/pop of coordinate system number.

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 0
        • Catalin_ROundefined
          Catalin_RO
          last edited by

          I'm on the same wavelength with Danal on this one! Unless specifically instructed through M120/M121, nothing should be saved/restored by default for maximum flexibility.

          Of course, workplace related settings should be included in the push/pop support as some of the workplace settings might be temporarily changed for the needs of the macro.

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