Has anyone set up a macro or some other way to have the g-code turn on a regular router at the beginning of a job and turn it off afterwards?

I have PracticalCNC Table and WinCNC control software.

I tried a search but found nothing. Was thinking you could leverage off of the cooling fluid pump on and off commands and hardware....

Has anyone tried this?

Is there something like this on the market already?

Thanks in advance.

Sam