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

    Macro file unable to call during print

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    5
    16
    517
    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.
    • SANJRundefined
      SANJR @jay_s_uk
      last edited by

      @jay_s_uk

      I tried applying the M98 P"0:/macros/5_WELD TORCH ON.g" command, but it is not responding. Not sure for this non-responsiveness.

      Can the M98 command be used in the print file?

      jay_s_ukundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @SANJR
        last edited by

        @SANJR yes, M98 can be used in a print file.
        if you're going to use that mid move it may be better to use an unused G/M code.
        So as an example on my pen plotted, when i was to lift the pen, i used M5000 and then to drop the pen i use M5001 and these are placed throughout the gcode.
        i then have a file for each one in the sys folder called M5000.g and M5001.g.
        The firmware will automatically run those files whenever M5000 or M5001 are used, whether its part of a gcode file or from the console
        Then, you just format/post process your gcode accordingly

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 0
        • deckingmanundefined
          deckingman @SANJR
          last edited by

          @SANJR Does the macro run "stand alone" if you just send the M98 from the console? It might be an idea if you post the macro code here.

          Ian
          https://somei3deas.wordpress.com/
          https://www.youtube.com/@deckingman

          SANJRundefined 1 Reply Last reply Reply Quote 0
          • SANJRundefined
            SANJR @deckingman
            last edited by

            @deckingman

            Yes the macro runs in standalone. The G-Code for the macro file is as follows,

            Weld Torch ON.g file
            ; Weld Torch ON
            M42 P3 S1

            Weld Torch OFF.g file
            ; Weld Torch OFF
            M42 P3 S0

            droftartsundefined 1 Reply Last reply Reply Quote 0
            • droftartsundefined
              droftarts administrators @SANJR
              last edited by

              @SANJR Note that:

              Case sensitivity

              The original NIST GCode standard requires GCode interpreters to be case-insensitive, except for characters in comments. However, not all 3D printer firmwares conform to this and some recognise uppercase command letters and parameters only.

              RepRapFirmware version 1.19 and later is case-insensitive, except for characters within quoted strings. RepRapFirmware version 1.18 and earlier accept only uppercase letters for command and parameter letters.

              https://docs.duet3d.com/en/User_manual/Reference/Gcodes#case-sensitivity

              Is the macro "5_WELD TORCH ON.g" or "Weld Torch ON.g"?

              Ian

              Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

              SANJRundefined 1 Reply Last reply Reply Quote 0
              • SANJRundefined
                SANJR @droftarts
                last edited by

                @droftarts

                The file name is WELD TORCH ON. To appear as a fifth file in the macro folder, i numbered it to be 5_WELD TORCH ON. I have tried it the following ways as of now

                1. M98 P¨WELD TORCH ON.g¨
                2. M98 P¨WELD TORCH ON¨
                3. M98 P¨macros/WELD TORCH ON.g¨
                4. M98 P¨macros/WELD TORCH ON¨
                5. M98 P¨0:/macros/WELD TORCH ON.g¨
                jay_s_ukundefined SANJRundefined droftartsundefined 3 Replies Last reply Reply Quote 0
                • jay_s_ukundefined
                  jay_s_uk @SANJR
                  last edited by

                  @SANJR you need the 5_ in the M98 call as well then

                  Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                  1 Reply Last reply Reply Quote 0
                  • SANJRundefined
                    SANJR @SANJR
                    last edited by

                    @SANJR
                    And also tried one combinations
                    M98 P¨5_macros/WELD TORCH ON.g¨

                    SANJRundefined 1 Reply Last reply Reply Quote 0
                    • droftartsundefined
                      droftarts administrators @SANJR
                      last edited by droftarts

                      @SANJR Please send M20 S2 P"/macros" and post the response.

                      Edit: It won't be a case-sensitive issue, because FAT32 is not case sensitive! But it is case-preserving.

                      Ian

                      Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                      SANJRundefined 1 Reply Last reply Reply Quote 0
                      • SANJRundefined
                        SANJR @SANJR
                        last edited by

                        @SANJR said in Macro file unable to call during print:

                        @SANJR
                        And also tried one combinations
                        M98 P¨5_WELD TORCH ON.g¨

                        1 Reply Last reply Reply Quote 0
                        • SANJRundefined
                          SANJR @droftarts
                          last edited by

                          @droftarts

                          Here is the response from the console

                          M20 S2 P"/macros"
                          {
                          "dir": "/macros",
                          "first": 0,
                          "files": [
                          "6_WELD TORCH OFF",
                          "3_MOTOR 1 OFF",
                          "4_MOTOR 2 OFF",
                          "1_MOTOR 1 ON AND SPEED CONTROL",
                          "2_ MOTOR 2 ON AND SPEED CONTROL",
                          "5_WELD TORCH ON"
                          ],
                          "next": 0,
                          "err": 0
                          }

                          jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                          • jay_s_ukundefined
                            jay_s_uk @SANJR
                            last edited by

                            @SANJR so torch on is

                            M98 P"0:/macros/5_WELD TORCH ON"
                            

                            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                            SANJRundefined 1 Reply Last reply Reply Quote 1
                            • SANJRundefined
                              SANJR @jay_s_uk
                              last edited by

                              @jay_s_uk Thanks

                              The macro files works. It seems the format of M98 command during the print needs to mention the location of the file i.e., in the directory where we placed it. And finally the extension of file .g is not required.

                              So the syntax to which my machine responds is M98 P"0:/macros/5_WELD TORCH ON" instead of M98 P"5_WELD TORCH ON"

                              It would be nice if notes are updated in the documentation which would be helpful to other users.

                              fcwiltundefined 1 Reply Last reply Reply Quote 0
                              • fcwiltundefined
                                fcwilt @SANJR
                                last edited by

                                @SANJR

                                It seems I organize my system code and my "macros" code differently from most.

                                In my setup the items in the macros folder are only there to provide access, from the DWC interface, to items in the system folder.

                                If other words items in the macros folder invoke, via M98, items in the system folder but no items in the system folder invoke items in the macros folder.

                                There are some items in the macros folder that have a line or two of code but nothing that I ever would need to invoke from the system folder.

                                Just FYI.

                                Frederick

                                Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Unless otherwise noted, all forum content is licensed under CC-BY-SA