Sign in to follow this  
Followers 0
Owain

kWh from kW

5 posts in this topic

Now, I know this is simple... kW * H = kWh... My problem is different... I have a power monitoring device (Diris A40) with a 4-20mA module giving me instantaneous power in kW, and from that I need to generate the previous 7 days kWh. Can it be done? I have a function block that takes a pulse to generate totals, and if I can generate this pulse from another bit of code I would sleep a lot better at night. I'm thinking of taking a rolling average over an hour and generating a pulse every ( 1 / AveragekW ) hours, or ( 60 / AveragekW ) minutes. Would this work? My brain is fried right now which I why I'm asking for help. I'm not asking for anyone to write my code, just outline how I might go about this or tell me I'm stupid and you simply can't do it. Before anyone says, this is for use over hundreds of aging sites, so it's cheaper and easier to develop a function block than buy the pulse module for the Diris. Thanks in advance

Share this post


Link to post
Share on other sites
You could accumulate kWh over a one hour period. Also create a buffer of 168 elements. At the conclusion of the hour, push the latest hour's kWh into the buffer and push out the oldest value. The sum of all 168 values in the buffer is the total over the past seven days.

Share this post


Link to post
Share on other sites
What PLC are you using? Many PLCs have a Totaliser function to accumulate volume based on measured flow rate. This is basically the same application, but kWh is the measured "volume" and kW is the "rate".

Share this post


Link to post
Share on other sites
Nailed it, thanks guys. I basically modded an old flow totaliser block (like Mr Automation suggested), works a dream. Thanks all round

Share this post


Link to post
Share on other sites
No problem. Glad to know it worked out for you!

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