4/19/2017 10:52 AM | |
Joined: 9/16/2010 Last visit: 10/3/2024 Posts: 109 Rating: (9) |
Hallo #dP, your restart is ever false. So see this little correction AttachmentPLC_CYCLE2.zip (511 Downloads) |
This contribution was helpful to2 thankful Users |
4/21/2017 12:53 PM | |
Posts: 2826 Rating: (686) |
For what it is worth - revision 3. It compensate for the overflow / roll-over effect. This is not solving my project issue, but it might solve yours. - Dan
AttachmentPLC_CYCLE_V3.zip (463 Downloads) |
Last edited by: #dP at: 4/21/2017 4:45:35 PMupdate note 1 |
|
This contribution was helpful to1 thankful Users |
4/22/2017 10:41 AM | |
Joined: 9/2/2008 Last visit: 6/30/2024 Posts: 191 Rating: (43) |
DAN, YOU'RE THE BEST! Your code is running perfectly! I think I was writing to the wrong variable... --------------------------------------------------------------------------------------------------------------------------------------
As I could see in your code above, you want a "0" value result (85.8997266578954 - 85.8997266578954 = 0).
And this is working as well. My "RunningTime program" - which I always use to measure and preset running hours - is running for over 5 hours now without any problem. Attached V4. Best regards, |
Last edited by: Alex Mol at: 4/29/2017 4:57:25 AMRemoved attachement V4 Problems don't exist, only challenges. |
|
4/22/2017 11:43 AM | |
Posts: 2826 Rating: (686) |
Hello Alex. Your compliment is very encouraging. Thank you. Not wanting to sour the situation but I do not agree with the change you made. I suggest you set in the hardware configuration that the PLC cycle is running at a minimum period. Then you can test versions 3 and 4 against each other. I suggest: To try and explain - begin with what RUNTIME is doing:
Where ET < 0 and delta2 is the time "distance" to the overflow event:
If the scan cycle is short (1ms and less), the fold-over event does not make too much difference. But with higher cycle times the difference is bigger. Added: Have a look at my other post to which I linked to. It has a STOPWATCH that works like a TONR time accumulator. - WEB LINK - Perhaps you will want to use it. Note that I assumed the #OVERFLOW := 85.9s. I enjoyed our discussion. Hope we do so again. Bye. |
Last edited by: #dP at: 4/22/2017 11:45:46 AM |
|
Follow us on