Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Scope of modal commands called from within macros

    General Discussion
    2
    4
    254
    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.
    • mwinterm
      mwinterm last edited by

      Hello,

      is there somewhere an overview which modal commands like e.g. G54, G90, G91... are limited in their effect to the macro scope and which are global?
      Currently when testing 2.03RC1 it caught me by surprise that G54, G55.... are not restricted to the macro scope. I thought this was the case with 2.02 but I might be wrong...

      Regards,
      Marc

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

        G53 has modal scope of the current line of GCode.

        When running macros, the following parameters are saved at the start and restored at the end: movement absolute/relative mode, extrusion absolute/relative mode, feed rate (G1 F parameter), and volumetric extrusion on/off. In the forthcoming 2.03RC1 firmware also the inches/mm setting.

        I can add to this list if there is general agreement on what items to add.

        HTH David

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

          Thank you for the clarification. I think generally it is hard to define which should be modal and which not for all cases. What about an additional g-code that limits all modal commands on a line to the scope of a macro.
          Or even more advanced mechanisms where the user can start and stop a new scope similar to C/C++ (e.g. Gxx.1 starting and Gxx.2 stopping a scope and even a Gyy in front of a modal command to render it global)?

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

            You can already declare local scopes using the M120 and M121 commands. The values saved and restored are the same ones as for macros.

            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. I think I'll start a new thread about this.

            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
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA