4/2/2020 2:29 PM | |
Joined: 12/3/2018 Last visit: 1/22/2024 Posts: 76 Rating:
|
ixo65, I didnt quite understand your weighting example. Here is what I am trying to do: I am calculating the heat energy from momental and average power. I have 2 sensors for temperature (Vorlauf, Rucklauf) and liquid (heating water) flow sensor. I have calculated momental power and then average it over some period (one hour for the test). The power results are in 5th row of LOGO display (first momental and then average power). Then I calculate the gained heat energy in that hour. That is displayed in the 6th row. I would need to store this value and then add it to new value which comes next hour. This is the part which I don`t know how to program. AttachmentTest program.zip (304 Downloads) |
4/2/2020 2:54 PM | |
Joined: 12/3/2018 Last visit: 1/22/2024 Posts: 76 Rating:
|
Because one hour is very long time for testing, I change a bit the program to be more "test friendly". The averaging time is one minute (you have to wait one minute to see the average value) and energy calculation can be done sooner with a press on C1 button, just to see it working. Some examples: Power 1000W (= 1kW) .... that means 1kWh energy in one hour. Power 1350W (= 1.35kW) ...... again 1kWh (because of rounding to lower number) Power 2730W (= 2.73kW) ....... gives a result 3kWh energy in one hour (because of rounding to higher number) If I want to calculate the energy in two hours, I need to store this value and add it to next one for the second hour. And so on... 32767 is big enough at this point. AttachmentTest program (shorter times).zip (313 Downloads) |
Last edited by: Frayer at: 04/02/2020 14:56:10 |
|
4/2/2020 3:43 PM | |
Joined: 12/18/2014 Last visit: 9/1/2024 Posts: 33660 Rating:
|
Hello Frayer, take a look at attachment. It's a possible solution. This solution counted your kW/h up to 999.999 kWh. With a litte trick and two counters more you can count up to 999.999.999.999. AttachmentTest program (shorter times)_V2.zip (337 Downloads) |
4/2/2020 9:36 PM | |
Joined: 12/18/2014 Last visit: 9/1/2024 Posts: 33660 Rating:
|
Attached is a proposal on how you can save and add up the exact energy value in W/h every hour. If you inserted in your program then must you the follows: You have to reference your calculated energy value per hour to B011 (parameter V1). The value of 32,767 is also only for the simulation. In your program must you set to 0. AttachmentCounter.zip (312 Downloads) |
4/3/2020 1:26 PM | |
Joined: 12/3/2018 Last visit: 1/22/2024 Posts: 76 Rating:
|
Hi, I put it together and now testing it. So, if I want to avoid rounding error, I have to calculate in Wh not kWh. That means the result will be in bigger numbers. This is a little bit unclear, because we are used to kWh. Maybe I will rather stick to your first solution with kWh and daily reading, I haven`t decided yet. I will test both versions and then decide. Can you tell me what is the purpose of "Protection active" setting of some bloc (I mean in general)? P.S.: Don`t be mad at me, I have to correct you since I am an electrician: the correct unit for energy is Wh (or kWh, MWh, Ws....) not W/h This is because you calculate the energy from power with equation " Energy (Wh) = Power (W) x time (h) " See "Misuse of watts per hour" in Wikipedia:https://en.wikipedia.org/wiki/Kilowatt-hour |
Follow us on