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

macros in Simplify3d

Scheduled Pinned Locked Moved
General Discussion
4
13
1.1k
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
    r123
    last edited by r123 29 Mar 2021, 09:16

    When run the following in DWC the appropriate macro executes.

    M98  P"0:/macros/dock and wipe"
    

    So pasted into Simplify3d start script as follows:

    ;M117 "Prime Extruder"
    T0 ;Select Extruder 0
    G92 E0 ;Reset E
    G1 E30 F200 ;Extrude 30mm
    G92 E0 ;Reset E
    G4 P3000 ; wait 3 seconds for filament to fall under own weight
    M98 P"0:/macros/dock and wipe"

    When ran the print the Macro didn't execute. Looking into the gcode find the following:

    M117 "Prime Extruder",T0 ;Select Extruder 0,G92 E0 ;Reset E,G1 E30 F200 ;Extrude 30mm ,G92 E0 ;Reset E,,G4 P3000 ; wait 3 seconds for filament to fall under own weight,,M98 P"0:/macros/dock and wipe",,;Railcore Printer Start Script End,

    Notice that there are commas (,,) before and after the M98 command. What are they doing there? Is that anything to do with why the command didn't execute?

    undefined 1 Reply Last reply 29 Mar 2021, 12:27 Reply Quote 0
    • undefined
      r123 @r123
      last edited by 29 Mar 2021, 12:27

      Hmm, I think the commas are benign. They might be carriage returns or something.

      So why isn't the Macro running on the Duet when the Gcode comes through?

      undefined 1 Reply Last reply 29 Mar 2021, 12:42 Reply Quote 0
      • undefined
        NexxCat @r123
        last edited by 29 Mar 2021, 12:42

        @r123 Simplify3D uses commas as a newline character when storing the profile and in the gcode header. Those should be fine.

        I'm running a macro in my S3D start gcode using the following syntax:

        M98 P"0:/macros/prime_nozzle.g" ; Run nozzle prime macro

        Perhaps try removing the spaces from the macro file name?

        undefined 1 Reply Last reply 29 Mar 2021, 12:44 Reply Quote 0
        • undefined
          r123 @NexxCat
          last edited by 29 Mar 2021, 12:44

          @nexxcat and you have added a ".g" to the filename. When I tried that in DWC it didn't accept it? So is the syntax different when sending from the slicer?

          undefined 1 Reply Last reply 29 Mar 2021, 12:48 Reply Quote 0
          • undefined
            NexxCat @r123
            last edited by 29 Mar 2021, 12:48

            @r123 said in macros in Simplify3d:

            @nexxcat and you have added a ".g" to the filename. When I tried that in DWC it didn't accept it? So is the syntax different when sending from the slicer?

            Not sure why DWC wouldn't accept that. All my macros have a .g extension.

            Here is my full start gcode from S3D, if that helps 🙂

            G28 ; Home all
            M190 R[bed0_temperature] ; Heat the bed to temperature
            G4 S60 ; Sleep for 60s to allow heat soak
            M290 R0 S0 ; Reset baby-stepping to 0
            G32 ; Level the bed
            G28 Z ; Re-home Z
            G29 S0 ; Probe the bed
            G1 X-100 Y-100 ; Move XY back to home
            G10 P0 S[extruder0_temperature] R160 ; Heat nozzle to print temperature
            M116 ; Wait until temperatures are reached
            M98 P"0:/macros/prime_nozzle.g" ; Run nozzle prime macro
            undefined 1 Reply Last reply 29 Mar 2021, 12:51 Reply Quote 0
            • undefined
              r123 @NexxCat
              last edited by 29 Mar 2021, 12:51

              @nexxcat ah, then I should be giving my macros a ".g" extension in the name which also appears in DWC?

              so call mine "Dock_Wipe.g" in DWC?

              undefined undefined 2 Replies Last reply 29 Mar 2021, 12:53 Reply Quote 0
              • undefined
                NexxCat @r123
                last edited by 29 Mar 2021, 12:53

                @r123 said in macros in Simplify3d:

                @nexxcat ah, then I should be giving my macros a ".g" extension in the name which also appears in DWC?

                so call mine "Dock_Wipe.g" in DWC?

                It's worth a try 🙂

                1 Reply Last reply Reply Quote 0
                • undefined
                  jay_s_uk @r123
                  last edited by 29 Mar 2021, 13:06

                  @r123 when creating a macro its not explicitly given a file extension.
                  So if you called it prime_nozzle (and thats what its shown as in DWC), thats a different file to prime_nozzle.g

                  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

                  undefined 1 Reply Last reply 29 Mar 2021, 13:09 Reply Quote 0
                  • undefined
                    r123 @jay_s_uk
                    last edited by 29 Mar 2021, 13:09

                    @jay_s_uk it works without the extension in DWC. But does it work without the extension when called from a gcode file. For me it didn't. Planning to try on next print renaming to .g and calling with .g . Unless hear otherwise!

                    undefined 1 Reply Last reply 29 Mar 2021, 13:31 Reply Quote 0
                    • undefined
                      r123 @r123
                      last edited by 29 Mar 2021, 13:31

                      Yay, that's it. The ".g" suffix is obligatory on the filename if you want to call it from a G-code file. However it's not if you want to just call the macro from DWC shortcut list, or if you want to call it from DWC's "send command window" using a M98 command etc.. Which is somewhat confusing to beginners.

                      Additionally, spaces and capitals are OK (human friendly);

                      [And, in case anyone's reading, I noticed that in the guide the M117 command does not require "" around the message it sends. However in most recent versions of firmware/DWC it does!]

                      undefined undefined 2 Replies Last reply 29 Mar 2021, 13:31 Reply Quote 0
                      • undefined
                        r123 @r123
                        last edited by 29 Mar 2021, 13:31

                        THanks @NexxCat @jay_s_uk 😉

                        1 Reply Last reply Reply Quote 2
                        • undefined
                          dc42 administrators @r123
                          last edited by 29 Mar 2021, 13:37

                          @r123 said in macros in Simplify3d:

                          Yay, that's it. The ".g" suffix is obligatory on the filename if you want to call it from a G-code file.

                          Normal practice is not to use a '.g' suffix on user macros, because the full filename of the macro (including any extension) less any leading digits followed by underscore is what should be displayed in the list of macros in DWC and on PanelDue.

                          When calling a user macro form M98 you will need to use the exact file name, including any leading digits and underscore.

                          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

                          undefined 1 Reply Last reply 29 Mar 2021, 13:55 Reply Quote 0
                          • undefined
                            r123 @dc42
                            last edited by r123 29 Mar 2021, 13:55

                            @dc42 it seems that DWC parses out any ".g" suffix on the filename for display purposes in the Dashboard (though not the macro file list).

                            As above, I found that if called a macro "my macro" it would not call from a gcode file produced by s3d start script.

                            (with M98 P"path/my macro" )

                            But if I called it "my macro.g" then it would call from the gcode file

                            (with M98 P"path/my macro.g")

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