G code help

Need some g-code support please.

I load the filament on the right side of the SM2 with enclosure. I would like a quick g-code project that moves the head to the right and heats up the nozzle for loading. I can move the head easily but as soon as the project is done it goes back home. I’ve tried the M600, M412 commands to no avail. With CNC or laser gcode the head can be moved and NOT go home after the project completes. In the 3DP, it always wants to go home. Any suggestions?

Thanks

Simply wait? For example 10minutes and abort the “job” when you finished loading? G4 S600

Or use the “go to swap position” button in the settings?

To do this, you’ll have to use some form of direct control system, such as Octoprint. Using Luban or the touchscreen will always have some form of start/end you cannot control. You need to send code directly to the controller, bypassing the touchscreen.

A Pi Zero 2W is a great option here, and is what I use. It can even be powered by the USB A port on the Snapmaker itself, making it a self-contained system.

You can find a list of Marlin gcode commands here,

and a list of commands supported on Snapmaker 2.0 printers here

https://wiki.snapmaker.com/en/Snapmaker_Luban/manual/2_supported_gcode_references

If I understand your questions correctly, you can modify the end gcode in your slicer. At the very end, add move (G0) and heat (M109) commands, or replace the G28; home at the end with the commands.

@Skreelink is essentially correct from what I can tell. There is no native way to do gcode and get what I want. I did finally get a work around to do what I want, but it was painful to get to the solution; lots of playing with code.

I tried playing with M412 - filament run out detection but there is no way (I could see anyway) to use the M412 in a file. If I sent M412 S0 from the Luban Workspace, I could get the code to work by forcing a run out. But I couldn’t turn off run out in a file, only from the workspace.

So I ended up going back to M600 and setting that up. The only problem is, I need to leave the print head loaded. So I’m leaving a small filament in the head then using code to move the head, heat the nozzle, expel the old filament, and put in new filament from my right side.

I think M412 might have worked the same if I left the head loaded with old filament and then purged some.

Anyway, got it to work. Thanks all