Yes, I'm back and I received your mail, but I was away for 16 days and your is one of the last mails, so there are a lot to reply before I get to yours.
Despite I have many working ATC macros and plugins I can't send you a working solution, because all of them is different. All of the plugins and macros was written for a specific machine using inputs and outputs to control the ATC. To be clear here are some ATCs that I remember without scanning all my macros/plugins:
- Simple one with only a tool release output and a line of rack positions.
- The same simple, but after tool change the tool is probed.
- Simple linear rack, but many inputs to check the ATC states e.g.: tool clamped, chuck open, chuck closed, spindle in index, 0 rpm, rack in, rack out.
- some others combining the list above, some using A, B or C to rotate the rack, etc.
- And the other end of the list is a very complex
M300 (the old green one) with a chain tool rack with wondering tools (the ejected tool goes into the nearest free position) and tool preload. This has an extreme number of I/Os while the change of the tool is very simple. (To change the tool you set an output and wait for an input in a given time.)
So, if you want to get a macro then you have to tell how the hardware works and what is the exact flow of control.