Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: willpoll on September 15, 2014, 03:47:50 PM
-
Hi all,
I'm guessing the limit on the preset for these timers is also the maximum value the timer can hold i.e. 2,147,483,647 milliseconds or 24.855 days. Can anyone confirm whether this is correct? I'm looking for a timer struct that I can use to monitor runtime on pump motors that would exceed this in a few months.
Thanks in advance,
Will
-
That is correct.
If you don't need millisecond accuracy, look into the Time/Date structure (including $Now) and associated DTxxx instructions.
-
Thanks BobO, I'll give that a look.
Will
-
If you are just wanting to integrate run time in seconds, it would be easier still to put $1Second on an edge contact in series with the pump enable driving an INC instruction.
STRPD $1Second
AND PumpEnable
INC RunTime
-
FYI, 2,147,483,647 seconds > 68 years ;D
Note that there is also a "Seconds Time" data format in Data View to intelligently display "number of seconds" (not "number of milliseconds" like "Timer" format). See the attached screen shot.
-
Thanks guys, I think I'll go with the $second edge contact AND pump run as input to a counter. 68 years should be plenty ;)
The data view in seconds will be handy also for debugging.
-Will