Sign in to follow this  
Followers 0
ReBroker

need to display on pv 550 machine operating hours

6 posts in this topic

Hi all, I need to track machine run time and dsiplay it on a 550 pv. I got a slc 5/04 processor. do you have any canned code you would like to share?

Share this post


Link to post
Share on other sites
No canned code, but a couple of ideas to suggest and you should be able to draft it yourself. 1. How accurate does your run time need to be? If the variability of a few milliseconds is no matter the palce your code in a standard routine otherwise place it in an sti which has predictable timing. 2. Once you decide where to place the code. use a timer or the call of the STI to give you a one shot bit true once every hour. Uswe that bit to increment your run counter whichj can be an N file with an add not necessarily a true counter. Personnaly I'd use a System running flag and a minutes counter. IF the system is running at the minute pulse I'd add one to minutes. If equal to 60 then I'd zero and add 1 to hour counter. Hope this is clear.

Share this post


Link to post
Share on other sites
This is a common idiom you will see used in AB PLC's: XIO Tx:y.DN TON ..... XIC Tx:y.DN .... (triggered once per cycle of the timer) In theory, if for instance the TON instruction fires once per second, you get a 1 second timer "tick" on the DN bit. However, this doesn't work in practice. The timer is affected by the scan rate since the timer doesn't expire until the next scan (it is roughly the length of the timer PLUS one scan time). It's a small difference but becomes obvious when you measure hours or days. There is a way to make the same code work accurately. Do it like this: 1. If you want say a 1 second timer, create a 2 second timer. Use the highest resolution timer available (hundredths of a second or milliseconds). 2. Use a GRT instruction to check when the timer has counted 1 second. When it does, SUBtract 1 second from the ACC (accumulator) of the timer and set a trigger bit. 3. Everything that depends on your timer "ticks" triggers off the trigger bit. This timer will be accurate. It will have some timing jitter (scan-rate dependent) but the average rate the ticks are generated will be accurate to within the limits of the PLC's own clock. If you use an STI, the jitter will be minimized. A second method that I use is this. Say you want a 1 hour tick timer and you have a PLC-5 which has the hour counter in S:21. Then do something like this: EQU S:21 N7:0 OTE B3/0 EQU S:21 N7:0 MOV S:21 N7:0 What this does is check to see if a cached copy of the hours (N7:0) is equal to the PLC hour. If not, then it sets a trigger bit (B3/0 in the example) and then updates the cached copy of the hour. A variation is this: EQU S:21 0 ONS B3/0 ..... What this does is to trigger once per DAY at midnight (when the hour rolls over to 0) exactly once (based on the ONS).

Share this post


Link to post
Share on other sites
ok i didnt find any "canned logic" so i wrote some myself. please review and let me know if you see any issues i missed. i ran it for a day on a trainer and it looked good. UNTITLED.RSS

Share this post


Link to post
Share on other sites
Here it is much simpler. I guess the timer accuracy is not an issue when reading in 0.1 hours. HOURMETER.RSS Edited by Sergei Troizky

Share this post


Link to post
Share on other sites
While mine will get the job done, yours is alot simpler.....hmmmm im going with yours Thanks

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