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

    Printer name as global variable used with M550

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    6
    193
    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.
    • Yaoundefined
      Yao
      last edited by

      hi, does anyone know how i can use multiple global variables into one string with the M550 (printername)?

      global AccName="Myprinter"
      global serial="467"

      How to combine these two behind the: M550 P.....

      Thanks!

      T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators @Yao
        last edited by T3P3Tony

        @Yao Have a look at string concatenation operator here:

        https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#binary-infix-operators

        e.g.
        M550 P{global.AccName^global.serial}

        www.duet3d.com

        Yaoundefined 2 Replies Last reply Reply Quote 1
        • Yaoundefined
          Yao @T3P3Tony
          last edited by

          @T3P3Tony it just returns the name to : My Duet...

          I cant even get

          M550 P{global.AccName}

          to work...
          i dont get it.

          1 Reply Last reply Reply Quote 0
          • Yaoundefined
            Yao @T3P3Tony
            last edited by

            @T3P3Tony

            my bad.
            line was before global !!!!🙄

            T3P3Tonyundefined 1 Reply Last reply Reply Quote 1
            • T3P3Tonyundefined
              T3P3Tony administrators @Yao
              last edited by

              @Yao i tend to use echo to test stuff from the console before trying it in an actual macro which helps debug.

              www.duet3d.com

              Yaoundefined 1 Reply Last reply Reply Quote 1
              • Yaoundefined
                Yao @T3P3Tony
                last edited by Yao

                @T3P3Tony the echo worked... but in the config.g that M550 was in the wrong location...
                I use an external file with all globals, this was loaded after the M550 command,
                ...I was not paying attention...

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