Configure the spindle as normal - this is required because we're hooking the spindle control so it needs to already be setup with enable, direction and speed ports:
; Configure Spindle for Modbus
M950 R0 T1 C"spindlepwm+spindleen+spindledir" L1999:24000 Q1000