I posted the programs i use to control a WinCNC based CNC using a BRX at
https://github.com/dberlin/CNC-PLCIt handles all the safety sensors from the spindle, the VFDs, the vacuum pump, etc.
Nowadays most of my controls are being done over ethernet/ip (i hate tons of cables) and i moved from analog spindle speed to PWM, but if you look in the history there are versions that do things the "more standard" way.
It's actually safer/better than the original machine PLC, as this one can properly high speed count the spindle revolution sensor, and so knows what speed the spindle is currently at for real, so it knows when it is up to the command speed, etc (instead of whether it's just spinning or not).
The one thing i miss is cyclic messaging in ethernet/ip