So found a bad bug in my M6 tool change code. There is a open loop when Z axis positions. I had my Rapid Override potentiometer at 0 which issues a feedhold. Then did a tool change, Z axis did not move into position and tool change code continued as if it was! Thankfully Z was in home position and worst was it dropped a tool holder in the machine.

So checking my code i found this....

Code:
// 4. Move to toolchange position Z-1.01inches from Reference Position
	{
	  Move(Z, -20528);
      while (!CheckDone(2))
	  WaitNextTimeSlice();	// wait until we are stopped
	}
It only checks to see if axis is done moving but not if it is in position. How do i check to see if Z axis is in position (-20528) and axis is stopped before code is allowed to continue?

Troy