M911 "string too long" error
-
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?
-
-
@NeoDue The current max string length of the P parameter to M911 is 80 characters, I make your string to be 90+.
-
@gloomyandy Just 80 characters... that explains it. Let's see how I can keep that. Thank you!
-
-
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)
-
@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.