You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old May 16th, 2020, 10:59 AM   #1
Stuwertz
Member
India

Stuwertz is offline
 
Join Date: Feb 2018
Location: *******
Posts: 44
Smile Hour meter programming in Rockwell

Hi all ,

Good day to everyone.

Can any one suggest how to program for hour meter In Rockwell L72 processors.
Im using power flux 527 in panel
. I need to know how many hours this drive Run .
  Reply With Quote
Old May 16th, 2020, 11:47 AM   #2
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,818
What I do is have a 6 second timer self reset and on DN I set a OneShot output.

If a motor/pump/fan/conveyor/valve/whatever is on that I want to log run-time I check if the item is on and the OneShot and count up a 'Minute' counter. a count of 10 = 1 minute.

When the minute counter is DN CTU 'OneHour' to 60 and reset the Minute counter.

Keep cascading counters and it will record trillions of hours.

The same 6 second pulse can be used for all items logged.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old May 16th, 2020, 12:18 PM   #3
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 845
many ways to do this: STI; RTC; etc.


Simplest (least code, not most efficient) is to keep a running total of some regular-in-time event when the flux 527 is running.


The code below monitors the seconds field of the real-time (wall clock), and adds (1/3600)h to the hour meter every time the value changes, when the flux 527 is running.


A knock against this approach is it misses running time when the PLC is off, and it also might reset the value on a power outage.



Alternate approaches: the ADD could be a counter; use the minutes DT[4] instead of seconds.


Using a timer is not ideal for this, as there will be a loss of accuracy at smaller presets, roughly inversely proportional to the timer Preset (a 36s timer that increments hmeter by 0.01 at a time might not be too bad, with an error probably well under 0.1%).


Code:
     flux_527
     running
  -----] [---+---|GSV          |---------+---
             |   |WallClockTime|         |
             |   |LocalDateTime|         |
             |   |DT[0]        |         |
             |                           |
             +---|DTR  |---|ADD      |---+
                 |DT[5]|   |hmeter   |
                 |31   |   |2.7778e-4|
                 |lasts|   |hmeter   |
  Reply With Quote
Old May 16th, 2020, 01:15 PM   #4
JeremyM
Lifetime Supporting Member
United States

JeremyM is offline
 
Join Date: May 2014
Location: Texas
Posts: 414
Quote:
Originally Posted by Stuwertz View Post
Hi all ,

Good day to everyone.

Can any one suggest how to program for hour meter In Rockwell L72 processors.
Im using power flux 527 in panel
. I need to know how many hours this drive Run .
These drives have built-in metering (in 10 hour increments) as a readable parameter by explicit messaging.
  Reply With Quote
Old May 16th, 2020, 02:01 PM   #5
Ken Moore
Lifetime Supporting Member
United States

Ken Moore is offline
 
Ken Moore's Avatar
 
Join Date: May 2004
Location: North, West, South Carolina
Posts: 2,764
There is a PlantPAX AOI called P_Runtime, it tracks current run time, total run time, number of starts etc... It's free too.
  Reply With Quote
Old May 16th, 2020, 02:08 PM   #6
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 15,343
The problem with doing lifetime hour counters in a PLC is that unless you take extra measures to store the accumulated value in non-volatile memory they will very probably be altered by a download.

A few years ago when I built a PLC-controlled system where it was necessary to count runtime for bearing life purposes, I used a relay output on the VFD to run an actual mechanical hour meter.

Jeremy already made the point I was composing my post to make; PowerFlex drives (7 series and 520 series) have a lifetime run meter built in that can be accessed with ordinary Parameter object explicit messaging.
  Reply With Quote
Old May 16th, 2020, 02:34 PM   #7
janner_10
Lifetime Supporting Member
United Kingdom

janner_10 is offline
 
Join Date: Dec 2014
Location: Tewkesbury
Posts: 989
Keep it simple. RTO which resets after an hour and increments a counter.
  Reply With Quote
Old May 16th, 2020, 04:44 PM   #8
Stuwertz
Member
India

Stuwertz is offline
 
Join Date: Feb 2018
Location: *******
Posts: 44
Quote:
Originally Posted by JeremyM View Post
These drives have built-in metering (in 10 hour increments) as a readable parameter by explicit messaging.
I checked in power flex 527 axes there is no any parameter regarding running hours . In power flex 525 I found this parameter .
  Reply With Quote
Old May 16th, 2020, 04:52 PM   #9
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,818
Regarding the runtime log in a VFD -



If you want to log the run hours for the drive (not the actual VFD run hours) then the parameter in the VFD would only be good until it had to be replaced. A new VFD will be 0 hours and kill the log.



I work on a waste treatment system for a customer in there shop and they usually have to change a VFD in it at least once every year.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old May 16th, 2020, 11:15 PM   #10
chantecler
Member
Venezuela

chantecler is offline
 
Join Date: Feb 2013
Location: Caracas
Posts: 24
Hi,

Attached the simplest way I program an hour meter. The problem arises (as Ken pointed out) when you download a new program the values are overwritten. I still don't know how to solve this issue. What I usually do is to modify the program online. But if I have to download a new program, I copy the current values, then I download the program and finally I modify the downloaded values
Attached Images
File Type: jpg Hour Meter.jpg (83.8 KB, 171 views)
  Reply With Quote
Old May 17th, 2020, 02:04 AM   #11
lee1968nh
Member
United States

lee1968nh is offline
 
Join Date: Nov 2010
Location: NH
Posts: 48
Quick Sanity Check for timer

Whatever you do, the "real" value will ALWAYS lag the value used from a timer that resets itself and makes some sort of incremental change in a counter...no matter the PLC. Timers do not go off at the "zero" time, they go off when the accumulated time exceeds the set point time. Better off to use a long-life timer and compare accumulated value to some fixed value(e.g. 6000 = 6 Sec. in AB world) and increment a 0.1 min interval from there. DO NOT reset timer until the thing is about to roll over. You're still guaranteed to lag "real time" but, at least you won't be adding to this error every 6 seconds.
  Reply With Quote
Old May 17th, 2020, 04:25 AM   #12
Stuwertz
Member
India

Stuwertz is offline
 
Join Date: Feb 2018
Location: *******
Posts: 44
Quote:
Originally Posted by chantecler View Post
Hi,

Attached the simplest way I program an hour meter. The problem arises (as Ken pointed out) when you download a new program the values are overwritten. I still don't know how to solve this issue. What I usually do is to modify the program online. But if I have to download a new program, I copy the current values, then I download the program and finally I modify the downloaded values
Hi,

Thanks for given an idea for including picture.
  Reply With Quote
Old May 17th, 2020, 05:33 AM   #13
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,818
Quote:
Originally Posted by lee1968nh View Post
Whatever you do, the "real" value will ALWAYS lag the value used from a timer that resets itself and makes some sort of incremental change in a counter...no matter the PLC. Timers do not go off at the "zero" time, they go off when the accumulated time exceeds the set point time. Better off to use a long-life timer and compare accumulated value to some fixed value(e.g. 6000 = 6 Sec. in AB world) and increment a 0.1 min interval from there. DO NOT reset timer until the thing is about to roll over. You're still guaranteed to lag "real time" but, at least you won't be adding to this error every 6 seconds.

Where critical accuracy is required I do 1 of 2 things, maybe a combination.


When the PLC is running I check the accuracy of the self-resetting 6 second timer and adjust it so a DN pulse is 6 seconds. That may be the preset is 5.985 or similar.


The second thing is to NOT reset the timer at 6 seconds, Do a compare GEQ T.ACC 6000 and OTE pulse and SUB T.ACC 6000 T.ACC.



This way the timer doesn't lose the DN and reset time loss. If the GEQ 6000 isn't accurate enough I change it to GEQ 5985 and SUB 5985.


But for most applications a self-resetting 6 second timer is good enough. The accuracy of the log would be within 2% and that would be good for maintenance needs for PM.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old May 17th, 2020, 08:38 AM   #14
lee1968nh
Member
United States

lee1968nh is offline
 
Join Date: Nov 2010
Location: NH
Posts: 48
Quote:
Originally Posted by Aabeck View Post
Where critical accuracy is required I do 1 of 2 things, maybe a combination.


When the PLC is running I check the accuracy of the self-resetting 6 second timer and adjust it so a DN pulse is 6 seconds. That may be the preset is 5.985 or similar.


The second thing is to NOT reset the timer at 6 seconds, Do a compare GEQ T.ACC 6000 and OTE pulse and SUB T.ACC 6000 T.ACC.



This way the timer doesn't lose the DN and reset time loss. If the GEQ 6000 isn't accurate enough I change it to GEQ 5985 and SUB 5985.


But for most applications a self-resetting 6 second timer is good enough. The accuracy of the log would be within 2% and that would be good for maintenance needs for PM.
The the thing is the accuracy will always be a -% not +-%. There are 86,400 one-tenth-minutes in a day. A consistent -2% error from a 6 second timer would add up to 2.88 minutes/day...pretty significant cumulative error. Roll the thing over once a day and you lose at worst, a single scan time. All this assumes that timer overall accuracy is 100%.

Last edited by lee1968nh; May 17th, 2020 at 08:59 AM.
  Reply With Quote
Old May 17th, 2020, 09:08 AM   #15
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 845
Quote:
Originally Posted by chantecler View Post
the simplest way I program an hour meter.

Very nice: clean; easy to understand; also provides the raw information for display as HH:MM:SS without any extra ugly arithmetic, which is something missing from my approach.

That said, I think it could be simpler:
  • the one-shot instructions (HM_ONS1; HM_ONS2 on rungs 1 and 2) might be unnecessary:
    • The [RES HM_mSec_Timer], on the lower output branch of Rung 1, will reset the HM_mSec_Timer.DN bit to 0 on the same scan that the latter is set to 1
      • So HM_mSec_Timer.DN is already, in effect, a one-shot
      • Even it that were not the case, CTUs have their own internal rising edge detector (i.e. one-shot)
      • The same reasoning applies to Rung 2 and the reset of the minute counter
  • I see the hour CTU preset is 1000001, but the accumulator will never reach that preset because the GEQ branch on Rung 3 will trigger a reset on hour 1,000,000.
    • Why do it this way, when a preset of 1000000 and using [XIC HM_Hour_Counter.DN] instead of the GEQ, would accomplish the same thing, as well as keep the logic in line with the previous two rungs for clarity?
    • Also, I notice there is not a one-shot here, event though this implements resets similar to Rung 1 and 2, which suggests the previous one-shots were put there for the CTUs.
  • Finally, 1e6h is over 114y: is that GEQ branch even necessary, or has your company found a source of very durable motors?
Thank you for posting your code: it is always interesting to learn from the approaches and design choices of others; and please be assured that none of my comments are meant either as destructive criticism or to say it works anything other than perfectly.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Function Block/ AOI Demonstration ndzied1 LIVE PLC Questions And Answers 11 December 13th, 2018 09:06 AM
KB4093108 causing issues on some Rockwell computers Stonent LIVE PLC Questions And Answers 0 June 12th, 2018 12:09 PM
FYI - Rockwell Software padees LIVE PLC Questions And Answers 8 August 27th, 2017 12:55 PM
Weigh feeder or flow meter .rss programming jitu360 LIVE PLC Questions And Answers 0 July 29th, 2014 06:45 AM


All times are GMT -4. The time now is 04:29 AM.


.