macros in Simplify3d
-
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?
-
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?
-
@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?
-
@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?
-
@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
-
@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?
-
@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
-
@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 -
@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!
-
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!]
-
-
@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.
-
@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")