Well depends what you are wanting to know, theres quite a lot
Basically I have my PLC taking Inputs and it also outputs. The ladder inside the PLC does certain things depending on what Inputs and Outputs are active. The PLC controls my gearbox clutches, the spindle Fwd/Rev, and spindle motors two speeds. I also have the front toolpost and rear turret, the coolant for front and rear, four or five panel buttons, and although I dont have the hydraulic chuck on now it also opened and closed the chuck and probably some other things that I have forgotten LOL.
Basically what happens is when my code asks for a tool my toolchange macro will send a signal to the PLC which will then start the toolchange routine, it keeps cycling until it sees the correct sequence of Inputs from the switches then stops and then sends a signal to Mach to tell it the correct tool is in position. If for some reason the correct tool is not seen then the turret will just keep cycling and Mach will just wait. The same goes for the front toolpost.
The ladder for the toolchange was pretty simple, the one for the gearbox cllutches is a bit more complicated as there are 5 clutches which control the eight speeds in each motor range, oh and thats the other thing I forgot, there are also a couple of limits on the manual gearbox lever so I know whether its in High or low ratio and if the speed I ask for is when I am in the wrong range it will tell me and wait for action. Below is the part of the ladder for the rear turret (tool1-6)
Hood