Ok, I must be loosing my mind or I pulled up the wrong macros.You were right there was something wrong with the macro, the script was blank.I filled in m3 and m5 and they work with MDI and G-code. Now what happens is if I manually enter speed in the spindle speed box, 15000, and enter m3 in the MDI input it works and the speed is correct m5 stops the spindle. If I now enter in the MDI input m3s18000 the DRO says 18000 but the spindle is still turning 15000. Thanks for your help ,Tommy