I would like to thank everyone who helped me .I figured out that its the M5 code causing the problems .Don't know how this wasn't caught .But when my system sees it ,,it stops everything .The spindle , motion Mach . Is this a bug...? I thought M5 just stops the spindle ?