Good afternoon,
as promised, I spent the weekend in the lab.
1.
As I stated, I am quite sure that the M6End Script is sometimes not started, or is interrupted by another "Ghost" sending commands to the trajectory planner. Maybe, Mach3 does not see wether the M6End Script is terminated before continueing with other (paused) operations.
To be sure that my tool-change script is able to finish properly, I attached the content of M6End Script to M6Start Script, generated a Message window to have a pause for the manual tool change. As a result, the M6End is no longer needed.
--> After this change, I could do tests for hours, without encountering any surprising events.
2.
Secondly, I noticed a clearly reproduceable position error after completing the tool change: Z-Axis was wrong.
So to say: Machine DRO and Work DRO are showing correct coordinates, but, the "Z target position" was incorrect.
"z = GetToolChangeStart(2)" delivers the WORK coordinates before start of the toolchange. Unfortunately, this value does NOT include the tool lenght offset. So, when commanding the return movement with a "straight feed" or "straight traverse" command, the Z position is wrong, because those commands need the "controlled point" as target coordinate, which includes the tool lenght offset.
Of course, it has to be taken into account that you need the tool lenght offset BEFORE performing the tool change and new tool measurement... So, you have to do it all in one script, or you have to use a global variable to store the "old" tool offset.
So, I am fine now, waiting for new adventures... I will inform you about the next crashed drill bit.
Regards, Konrad