I think what you want to do to compare the next spindle speed with the current spindle speed and if a high/low range is required, then output your M0 and comment. Otherwise you are going to get a "spindle speed high/low" at each speed change when you don't require a range-change. |