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

M117 and Conditional GCode Statements

Scheduled Pinned Locked Moved Solved
Gcode meta commands
5
9
798
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.
  • undefined
    mwolter
    last edited by mwolter 5 Jan 2020, 23:50 1 May 2020, 17:30

    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
    • undefined
      OwenD
      last edited by OwenD 5 Jan 2020, 22:33 1 May 2020, 22:32

      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

      undefined 1 Reply Last reply 2 May 2020, 08:11 Reply Quote 0
      • undefined
        Phaedrux Moderator
        last edited by 1 May 2020, 21:59

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

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • undefined
          OwenD
          last edited by OwenD 5 Jan 2020, 22:08 1 May 2020, 22:08

          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 😉

          undefined 1 Reply Last reply 1 May 2020, 22:09 Reply Quote 0
          • undefined
            Phaedrux Moderator @OwenD
            last edited by Phaedrux 5 Jan 2020, 22:09 1 May 2020, 22:09

            @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
            • undefined
              gtj0
              last edited by gtj0 5 Jan 2020, 22:15 1 May 2020, 22:14

              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
              • undefined
                OwenD
                last edited by OwenD 5 Jan 2020, 22:33 1 May 2020, 22:32

                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

                undefined 1 Reply Last reply 2 May 2020, 08:11 Reply Quote 0
                • undefined
                  OwenD
                  last edited by 1 May 2020, 22:38

                  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
                  • undefined
                    mwolter
                    last edited by 1 May 2020, 23:50

                    Thanks @OwenD, that works.

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      dc42 administrators @OwenD
                      last edited by 2 May 2020, 08:11

                      @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
                      5 out of 9
                      • First post
                        5/9
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA