That depends on the I/O requirements of your system. You need to provide more details about your turret. There have been some PLC programs for various types of turrets.
1- Tool counter input and tool 1 input.
2- Gray code logic.
3- Time based.
Some of those PLC programs have been created for systems that use either 1 output or 2 outputs for the turret motor. There has even been a custom tool change macro for turrets that are driven just like any other axes. You can find all this information on Centroid's forum
Centroid Community CNC Support Forum - Centroid Community CNC Support Forum.