Auto start and stop spindle with fusion 360

I have a 1000 mm x-carve with the Dewalt 611 spindle. I installed a relay to control the start and stop from the software.
Now, I would like to know how can I do it. I use fusion 360 and a universal gcode sender.