Modbus4J Modbus RTU master
-
@jeremyh below is the sample of my database.
could you teach me how to calculate.
-
Just use the deltas. In energy/utility metering a 15 minute interval is generally used.
at 10:00am the MWh used was 122.858
at 10:15am the MWh used was 122.859122.859 - 122.858 = 0.001 MWh or 1kWh used in the 15 minute period.
Because you are measuring in MWh you lack the resolution to get tenths of kWh, so you should consider storing more decimals if you can, or reading from a kWh register if you can.
If that's not an option then you could integrate using the method/s discussed here: http://physics.stackexchange.com/questions/109295/calculating-kwh-from-time-series-of-kw
You could very crudely say that if the average demand over the 15 minute period is 4.75kW then the energy consumed in that 15 minute period (which is 1/4th of an hour) is (1/4 hours)*4.75 kWh = 1.1kWh.
-
Is it correct ? Do i need to sum all the KW and I will get the total consumption for an hour ?
(1/4 * 4.8) + (1/4 * 4.9) + (1/4 * 4.8) + (1/4 * 4.8) = 4.825 KWH
-
No. You would need to do:
(1/samples per hour) * (sum of kilowatts over period) = kilowatt-hours
i.e. (can't believe you made me type this):
(1/60) * (4.872+4.873+4.808+4.896+4.744+4.768+4.896+4.832+4.816+4.776+4.888+4.872+4.760+4.840+4.792) = 1.2kWh
This is honestly a really bad and dumb way to do this though. It is very inaccurate and if you miss any measurements your energy will be even further off. Just add the kWh register (rather than MWh) from your panel meter and calculate the difference every period - that is what it's there for!
If you ended up with 15-minute energy kWh then to get hourly energy you would just sum the kWh. Energy can be added to energy.