Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
P
If you use push button via the digital input, then use own control mechanism (pulse counter) with reset from ligth sensor falling edge.
T
You will need a function block where you will solve who will be the winner (if the DI has priority, or the HMI gadget, or the last one...).