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

    M911 "string too long" error

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    5
    181
    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.
    • NeoDueundefined
      NeoDue
      last edited by NeoDue

      I want to save one global variable in case of a power loss since this is not done automatically, and I expected this code to do the job:

      M911 S22.0 R23.5 P"M913 X0 U0 Y0 Z40 E0:0 G91 M83 echo >""Modus.g"" ""set global.Modus = ""^{global.Modus} G1 Z1 F12000"
      

      (double quotes are set for every quote as noted by @dc42 in this post)

      But I get a "string too long" error - and I wonder why. The whole command has 99 characters which is well below the 256 characters maximum of RRF 3.5.1. Can anyone point me towards my error?

      gloomyandyundefined 1 Reply Last reply Reply Quote 0
      • NeoDueundefined NeoDue marked this topic as a question
      • gloomyandyundefined
        gloomyandy @NeoDue
        last edited by

        @NeoDue The current max string length of the P parameter to M911 is 80 characters, I make your string to be 90+.

        NeoDueundefined 1 Reply Last reply Reply Quote 0
        • NeoDueundefined
          NeoDue @gloomyandy
          last edited by

          @gloomyandy Just 80 characters... that explains it. Let's see how I can keep that. Thank you!

          NeoDueundefined 1 Reply Last reply Reply Quote 0
          • NeoDueundefined NeoDue has marked this topic as solved
          • NeoDueundefined
            NeoDue @NeoDue
            last edited by NeoDue

            If anyone happens to have the same issue: use the file name as variable. That complicates somewhat the code in resurrect-prologue.g (you need to check for each possible file name if that file exists and recreate the associated variable(s) instead of just executing it), but shortens the string significantly:

            M913 X0 U0 Y0 Z40 E0:0 echo >{""r""^global.Modus} G91 M83 G1 Z1 F12000
            

            (I added "r" as a bit of luxury 😇 to place the file close to "resurrect.g", since the variable only consists of a number in my case. Using only the variable gives you six precious characters more)

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

              @NeoDue I've increased the maximum length of that string in the source code. In the next release it will be limited only by the maximum GCode command length, which is currently 256 characters.

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