@oziken:
Please perform the exercise suggested in
post #11.
Also note that this problem, mentioned in the original post of this thread, is from chapter 8 (
https://sanamrao123.files.wordpress.com/2015/04/ch-8.pdf) of [Programmable Logic Controllers by Petruzella], and the name of that chapter 8 is "Programming Counters." Since that exercise (#11 of chapter 8) is about counters, it seems that you should be using a counter in the solution. I recommend studying Figure 8-8 on page 152.
I would also recommend chapter 7 (
https://sanamrao123.files.wordpress.com/2015/04/ch-7.pdf), called "Programming Timers," of the same book, especially Figure 7-11 at the bottom page 129.