Sign in to follow this  
Followers 0
dhoneycutt

Elapsed Time Project

5 posts in this topic

Hello, I need to program a function to measure 20 seconds elapsed time to 0.1 seconds and display on an AB PanelView with an AB ML1400 processor. I am using I:0/1 to start RTO with the time base set to 0.01. I use DIV to divide the accumulator by 100 and store the result in N7:0. I am using a Panelview to monitor N7:0. Seems N7:0 rounds the DIV result to whole numbers. Any ideas? Thanks, David

Share this post


Link to post
Share on other sites
N register is only whole numbers - use F register for floating point.

Share this post


Link to post
Share on other sites
Or don't divide the number at all. The Panelview tag setup can divide the number (actually multiply by .01) and display with 2 decimal points.

Share this post


Link to post
Share on other sites
Good point I have a personal preference for doing all the math in the PLC and letting displays... display. But there is certainly no hard and fast rule on that. Over a slow or unreliable data connection you don't want to send any more data (i.e. 2 word floats as opposed to one word integers) than you have to so sending an integer and doing the div in the display is appropriate in that case.

Share this post


Link to post
Share on other sites
Lots can be said about measuring the 20 seconds, but my advice is use a free-running timer that can go up to for instance 60 seconds and each time it is greater then 20 seconds subtract 20 seconds from the accumulated value. If you wait for the 20 second timer to be done, process on the dn and reset and restart the timer you'll introduce a minisicule amount of error that will accumulate so that in a day of 86400 seconds which should have 4320 intervals you might only get 4318 intervals.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0