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

    Concatenating strings in parameters

    Scheduled Pinned Locked Moved
    Beta Firmware
    2
    3
    287
    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.
    • nikschaundefined
      nikscha
      last edited by

      I want to display a customized message with the M291 command. In the message I want to refer to the current tool number.
      Can I use concatenation as introduced with RRF3 and Strings like this:?

      M291  P"Filament slot" ^ state.currentTool ^ "is empty" S3
      

      Or can I declare a variable and refer to that variable in the parameter like this:?

      var text = "Filament slot" ^ state.currentTool ^ "is empty"
      M291 Ptext S3
      

      If not, can we get this as a feature please?

      Stay in school

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

        For how to use expressions as parameters in G- and M-commands, see https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Use_of_expressions_within_GCode_commands.

        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

        nikschaundefined 1 Reply Last reply Reply Quote 1
        • nikschaundefined
          nikscha @dc42
          last edited by nikscha

          @dc42 stupid me, thank you so much!

          Stay in school

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