Forum

Plant kWh total in ...
 
Notifications
Clear all

[Solved] Plant kWh total in a CompactLogix went to minus 2 billion after 24 days

6 Posts
3 Users
0 Reactions
4 Views
 edj
(@edj)
New Member
Joined: 2 years ago
Posts: 0
Topic starter   [#47]

Morning all,

Main incomer here. A power meter feeds kW into a 1769 L30ER over Ethernet, and the controls guy wrote us a running kWh total for the monthly report before he left. Every second it adds the meter's W reading divided by 3600 into a DINT called Wh_Total, and the screen shows that divided by 1000.

Ran fine for 24 days and matched the meter within a percent. This morning the screen's showing minus 2,147,428 kWh and counting up from there.

First thing I did was check the meter, and its own kWh register is fine and still climbing, so then I went through the incomer and there's no trip and nothing on the recorder either. Plant runs about 3.5 MW average, not sure if that matters.

Did the meter reset, or is this the PLC? A number that big and negative looks more like the PLC to me, but I'm not sure what would do that after 24 days of it behaving.


Advertisement

   
Quote
(@northbay)
New Member
Joined: 1 year ago
Posts: 0
 

Is Wh_Total a DINT or a REAL, and what was the last value the historian logged before it went negative? The exact digits, not the kWh on the screen.



   
ReplyQuote
 edj
(@edj)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

DINT, says so in the tag list. Historian has 2,147,480,112 at 05:58 and then -2,147,428,851 at 05:59. The meter's own kWh reads 2,148,900 since it was last reset, which was the same day the PLC started counting.



   
ReplyQuote
(@scott_m)
New Member
Joined: 1 year ago
Posts: 0
 

That's the DINT ceiling. 2,147,483,647 is the biggest number a 32 bit signed integer holds. Yours was counting Wh, not kWh, so at 3.5 MW it got there in about 25 days and rolled over to the most negative value. Nothing reset.

Totalise in kWh instead. Keep a REAL sub total of Wh, and each time it passes 1000 add 1 to a DINT kWh and take 1000 back off the REAL. That DINT outlives the building. Or LINT, if the controller and the historian both handle it. Or a daily total that rolls at midnight and let the historian add the days up, which is what I'd do, because a PLC totaliser is a number nobody trusts after the first power cycle anyway. Someone did an article on the energy side: https://plctr.com/using-plc-for-energy-management-and-conservation/



   
ReplyQuote
 edj
(@edj)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Did the kWh carry like Scott said, REAL sub total into a DINT kWh, and seeded the DINT from the meter's own register so the report doesn't start from zero. Screen matches the meter within a kWh now.

So nothing reset and nothing failed. The DINT was counting Wh and simply ran out of room at 2,147,483,647 after 24 days at our load, then wrapped round to the far end. Counting in kWh with the carry keeps it inside a DINT for longer than the building will stand.

What I haven't sorted is the historian. It's got the negative minute and the flat days either side of it in there, and the monthly report adds the lot up, so somebody's patching that by hand before it goes out Friday. Thanks scott_m and northbay.



   
ReplyQuote
(@northbay)
New Member
Joined: 1 year ago
Posts: 0
 

Two billion Wh, 24 days at 3.5 MW. The maths checks out.



   
ReplyQuote
Share: