@phaedrux Please feel free to use code in documentation. In former post I just modified control of Power Supply to the Fan Pin FelixH was using.
here is the macro with my pin out.
M950 P0 C"exp.heater3" ; M42 P0 S255 to switch on Laser power supply, M42 P0 S0 power supply off
M950 P3 C"nil"
M950 P3 C"exp.heater6" Q20000 ; Laser control to P3
M42 P0 S255 ; Laserpower on
G04 P1000 ; Breake stabilizing laser power supply
M42 P3 S0.01 ; Laser on with 1% power
; following lines automatically switch off Laser power and power supply after 3 seconds. You can put M42 XX commands to a separate Macro to switch off laser independently.
G04 P3000 ; wait 3 seconds, then
M42 P3 S0 ; turn off laser control and power supply
M42 P0 S0
My Duet is on 3.4 B7 Firmware on Duet2 Ethernet. The macro works well until i switch to CNC mode defining "exp.heater3" for spindle power. From that moment the heater3 pin is only usable in CNC mode. Leaving CNC mode does not free the pin. No further control in Laser or FFF mode. My only solution is a reboot of Duet.
B.t.w On 3.4 b7 firmware I added following code to config.g :
M950 P0 C"exp.heater3" ; Floating Pin? Define it an switch it off
M42 P0 S0 ; Power Ausschalten
Without putting "exp.heater3" to defined status it seems to be floating and it fires spindle frequently.
I wish you a Merry Christmas.