8/18/2014 10:54 AM | |
Joined: 10/7/2005 Last visit: 1/17/2025 Posts: 3030 Rating: (1058) |
Hello Jens_app I'm a bit confused, so allow me to hark back on this subject. If seconds accuracy is all you need and you count in seconds, uel123's advice is very valid as a DINT valueof + 2 147 483 647seconds is about 68 years which would surely suffice for a pump runtime. As you experience a wrap around of the DINT from + 2,147,483,647to - 2,147,483,648, I suspect though that you do indeed count in milliseconds, which then"only" gives you about 24 days for + 2,147,483,647ms. Question: Why not count your runtime in full seconds in a DINT and be happy that it will lastfor 68 years? As for the REAL option, I fear that it may fail as the precision for a REAL is about 6 decimal places (see How accurately can I calculate with REAL numbers that are used in extensive formulas? for more). Just in case counting in seconds and/or 68 years of runtime is not enough, I would make my own "Long DINT" counter that let's say counts up to 1Billion in oneDINT, resets that DINT back to zero and adds1 to a second DINT value that represents the Billion count value (and link both to the HMI and have two output fields side by side for the display of the "combined" value). I hope this helps |
Cheers |
|
This contribution was helpful to2 thankful Users |
Follow us on