Help with a circuit 24 volts

#1
say i have a machine at work that when it runs activates a cylinder that i don't need to run every machine cycle. what i would like to do is add some type of timer that will count at the counts i set and then close a set of contacts for a time that i can set of not just as long as they are closed to allow the cylinder to cycle. then start over.

the machine is plc controlled but i have no access to the program or i would just add some logic and a valve and do it that way. i have asked the boss to get it done but he is not fast and it has been 6 months and still nothing. so i will do it but the best way is to find a timer that counts to activation i can then create a circuit that will time out to reset, unless the timer has both options. thanks for any help