I don't understand your requirement. Please show the hours on your timing diagram.
This is how it should work I created video from my screen.
https://vimeo.com/user117954686/revi...219/e91e715863
I don't use real time stamp or hours, I start the process from button. It is for simulation stand just to show that if smth was ON, we have data from sensors thats all. Then according to buttons the output is ON for 3 sec, this time (3 sec) is fixed and I wrote it using CASE. If button is ON and period time from 0..3 for button 1 I activate OUT, if time 3..6 for button 2 and so on. Time is used from 1sec counter, it counts till 24 sec, then I reset it and process start again.
So I wanted to change somehow that time for output would be flexible. That's a question for that's why I asked how to do it.
Thanks a lot.