Hi,
the Lua script tests, or rather asks the question, 'What tool is in the spindle right now? If it is the same as the new tool
requested....then Mach does not have to do anything'
There are two interpretations about tool numbers in Mach4.
1) Tool number is required tool.
For example:
M6 T14
requires that tool number 14 be fitted to the spindle.
2) Tool number is the next required tool.
For example:
M6 T14
will put the new tool in the spindle but load tool 14 into the toolchanger.
This last example may seem strange but is common on production machines. A production machine may have a carousel of 20 or more tools,
and one more tool is loaded into the toolchanger. In order to speed the toolchange you want the required tool already in the toolchanger
already. Thus the instruction is that tool 14 be shifted from the carousel into the toolchanger ready for the next M6 and therefore the speediest
of toolchanges.
Craig