This is what I came up with for my tool changer. Works nice
My machine has a 24 tool magazine. The Z-axis goes home and the tool mag. moves under the spindle. The tool unclamps and the mag. does down. The mag then moves CW or CCW, depending on shortest route to next tool. The mag then moves back up , the tool clamps, and the mag moves to it's back position.
Some of the inputs and outputs:
OUTPUT2 = Tool unclamp
OUTPUT3 = Magazine Forward (Moves mag. under spindle)
OUTPUT4 = Mag. Down
OUTPUT5 = Mag CW
OUTPUT6 = Mag CCW
OUTPUT10 = Orientates the spindle for a tool change
OEMTRIG8 = Mag. Back switch - Input
OEMTRIG9 = Mag. Forward switch - Input
OEMTRIG10 = Mag Up switch - Input
OEMTRIG11 = Mag Down switch - Input
OEMTRIG12 = Mag Position counter switch - Input
OEMTRIG14 = Tool Clamped switch - Input
OEMTRIG15 = Tool Unclamp switch - Input