The common M codes for coolant on/off is M8 M9. The machine control logic is written to turn the appropriate output/relay on and off. The logic for this is almost nill as usually there is no conditions required for this operation.
If your control has pre-written routines for M8 M9 then it is usually a case of hooking up the pump to the output/relay assigned for this.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.