M117 and Conditional GCode Statements
-
M117 does not allow conditional gcode statements to be inserted into a string.
Standalone Duet 3
M117 {move.calibration.initial.deviation}
M117 hello {move.calibration.initial.deviation}
-
Actually, this combination works with M117
M117 {"Axis " ^ (move.axes[0].letter) ^ "not homed. Please wait while all axes are homed"}
BUT
When I added a space at the start of the second string it failed.
Then it worked.... sometimesM117 {"Axis " ^ (move.axes[0].letter) ^ " is not homed. Please wait while all axes are homed"}
Not sure if there's something screwy going on with caching in DWC here, but the same command sometimes works and sometimes doesn't
-
What if you enclose the hello in double quotes.
"hello"
-
I can confirm that the commands for the various dialog boxes (M117, M291 )etc don't accept conditional code.
I swear I posted about it in the firmware wish list but can't find it.I wouldn't call it a "bug"
Those command require a quoted string.BTW, your M117 example should be "hello" ^ {my_conditional_code}
But it still won't work
-
@OwenD It may have been moved to the Beta firmware forum
All of your posts should still show up in your user profile -
I asked about it in the DSF Development forum as well but never got an answer...
https://forum.duet3d.com/topic/15662/dsf-examples-for-code-expressions-are-now-preparsedDoesn't appear to work in standalone mode either.
-
Actually, this combination works with M117
M117 {"Axis " ^ (move.axes[0].letter) ^ "not homed. Please wait while all axes are homed"}
BUT
When I added a space at the start of the second string it failed.
Then it worked.... sometimesM117 {"Axis " ^ (move.axes[0].letter) ^ " is not homed. Please wait while all axes are homed"}
Not sure if there's something screwy going on with caching in DWC here, but the same command sometimes works and sometimes doesn't
-
HA!
Got it on M291
I swear I tried all this yesterdayM291 P{ "Axis " ^ (move.axes[0].letter) ^ " not homed. Continue?"} R"Check axis" S3
-
Thanks @OwenD, that works.
-
@OwenD said in M117 and Conditional GCode Statements:
Not sure if there's something screwy going on with caching in DWC here, but the same command sometimes works and sometimes doesn't
DWC doesn't display a message if it was exactly the same as the previous one.