Navigation

    Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    SOLVED M117 and Conditional GCode Statements

    Gcode meta commands
    5
    9
    220
    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.
    • mwolter
      mwolter last edited by mwolter

      M117 does not allow conditional gcode statements to be inserted into a string.

      Standalone Duet 3

      M117  {move.calibration.initial.deviation}
      

      Screen Shot 2020-05-01 at 10.26.08 AM.jpg

      M117  hello {move.calibration.initial.deviation}
      

      Screen Shot 2020-05-01 at 10.27.29 AM.jpg

      1 Reply Last reply Reply Quote 0
      • OwenD
        OwenD last edited by OwenD

        Actually, this combination works with M117

        M117 {"Axis "  ^  (move.axes[0].letter)  ^  "not homed.  Please wait while all axes are homed"}
        

        Screenshot_2020-05-02 Flsun_I3_Duet.png

        BUT

        When I added a space at the start of the second string it failed.
        Then it worked.... sometimes

        M117 {"Axis "  ^  (move.axes[0].letter)  ^  " is not homed.  Please wait while all axes are homed"}
        

        Screenshot_2020-05-02 Flsun_I3_Duet(3).png

        Not sure if there's something screwy going on with caching in DWC here, but the same command sometimes works and sometimes doesn't

        dc42 1 Reply Last reply Reply Quote 0
        • Phaedrux
          Phaedrux Moderator last edited by

          What if you enclose the hello in double quotes. "hello"

          Z-Bot CoreXY Build | Thingiverse Profile

          1 Reply Last reply Reply Quote 0
          • OwenD
            OwenD last edited by OwenD

            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 😉

            Phaedrux 1 Reply Last reply Reply Quote 0
            • Phaedrux
              Phaedrux Moderator @OwenD last edited by Phaedrux

              @OwenD It may have been moved to the Beta firmware forum
              All of your posts should still show up in your user profile

              Z-Bot CoreXY Build | Thingiverse Profile

              1 Reply Last reply Reply Quote 0
              • gtj0
                gtj0 last edited by gtj0

                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-preparsed

                Doesn't appear to work in standalone mode either.

                1 Reply Last reply Reply Quote 0
                • OwenD
                  OwenD last edited by OwenD

                  Actually, this combination works with M117

                  M117 {"Axis "  ^  (move.axes[0].letter)  ^  "not homed.  Please wait while all axes are homed"}
                  

                  Screenshot_2020-05-02 Flsun_I3_Duet.png

                  BUT

                  When I added a space at the start of the second string it failed.
                  Then it worked.... sometimes

                  M117 {"Axis "  ^  (move.axes[0].letter)  ^  " is not homed.  Please wait while all axes are homed"}
                  

                  Screenshot_2020-05-02 Flsun_I3_Duet(3).png

                  Not sure if there's something screwy going on with caching in DWC here, but the same command sometimes works and sometimes doesn't

                  dc42 1 Reply Last reply Reply Quote 0
                  • OwenD
                    OwenD last edited by

                    HA!
                    Got it on M291
                    I swear I tried all this yesterday 🙄

                    M291 P{ "Axis "  ^  (move.axes[0].letter)  ^  " not homed.  Continue?"} R"Check axis" S3
                    

                    Screenshot_2020-05-02 Flsun_I3_Duet(4).png

                    1 Reply Last reply Reply Quote 0
                    • mwolter
                      mwolter last edited by

                      Thanks @OwenD, that works.

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

                        @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.

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