06-23-2022 03:44 AM
Hey there,
I have a indicator in my code I want to show time elapsed in the front panel when the indicator is on. When Indicator is turned off and on again I need to ask user if he wants to continue from the previous time or restart the time from zero on my elapsed time indicator in front panel. How do I do that?
06-23-2022 04:12 AM - edited 06-23-2022 04:13 AM
Seems simple enough. What have you tried so far?
06-23-2022 04:57 AM
I have tried this and it works but the problem with it is my ch4 event has other operation and it is triggered occasionally so the dialog box will keep popping up.
06-23-2022 05:22 AM - edited 06-23-2022 05:40 AM
06-23-2022 05:50 AM
Here's a quick draft. You still need to decide what should happens to the timer when the switch is operated, e.g. if it should count time when the button is off or not. Possibly, you need to add another shift register to store the ticker at the time it is turned off. (not shown)
06-23-2022 08:12 AM
Thank you for this I'll implement this and see if it requires any modifications. The code is big so unfortunately I can not put it here.
I hope I can explain my problem as following:
1. I have numeric control if the value of it is greater than 0 than ch4 indicator will be on and of the value is zero then ch4 indicator will turn off.
2. I have put this ch4 indicator in numeric control's event and made it true.
3. The timeout of my event structure is -1 so cannot use that event structure for time counting.
4. I want to display and start timer whenever ch4 indicator is on but also it should ask user to restart or continue timing from the past timing.
06-23-2022 09:02 AM
@doc_d wrote:
Thank you for this I'll implement this and see if it requires any modifications. The code is big so unfortunately I can not put it here.
I hope I can explain my problem as following:
1. I have numeric control if the value of it is greater than 0 than ch4 indicator will be on and of the value is zero then ch4 indicator will turn off.
2. I have put this ch4 indicator in numeric control's event and made it true.
3. The timeout of my event structure is -1 so cannot use that event structure for time counting.
4. I want to display and start timer whenever ch4 indicator is on but also it should ask user to restart or continue timing from the past timing.