Cj
as I said I am not the best at VB so maybe I am reading things wrong but this is how I think your turret must work;
Toolchange is asked for so output 4 is turned on, this rotates the turret until it sees the switches for Tool you have asked for, once they are seen OutPut 4 is switched off and toolchange is complete.
Is this how it works? Are there any unclamping/clamping mechanisms or brakes? Is the turret meant to move a certain distance after the inputs are seen?
Hood