Reference
G-code Examples
; Example: switch to filament 2
; define positions as needed for your build
M117 Switching to filament 2
; retract current
G1 E-10 F1200
; index mechanism forward
G1 X128 F2000 ; move to the measured X position for slot 2
; advance new filament
G1 E10 F1200
; purge
G1 E15 F900