The G Codes required for turning on the spindle are
then delay 5 Seconds to allow spindle spin up
and for turning spindle off.
For milling PCBs I added these g codes to the software FlatCAM Options Tab.
Prepend to G Code
M3 S1 G4 P5.0
and Append to G Code
This then means when the G Code is generated from my PCB design at the beginning of the job the spindle will spin up wait 5.0 Seconds start milling and finally will stop the Spindle at the end of the job. This hopefully will reduce the wear on the spindle by only having it on when it is doing some milling.