Have you written your new M6 code yet? I think what you're trying to accomplish is taken care of by change_prolog and code you write into M6.
If I understand correctly, you have a rack toolchanger. To do a tool change, you naturally have to
1.) Move over the tool 2.) Lower over the tool 3.)clamp the tool.
There are a few more steps to a robust, successful M6, like checking for tool in spindle, etc.
I suggest reading up
HERE
. It feels like a lot (and it is), but it can be done. I have an example of a carousel style changer that works (almost entirely), if you want to look at that.
You will need to include stdglue.py if you want to use the standard prolog and epilog. The Prolog prepares the tool number info I think.
Let me know if I'm off base.