1/10/2021 12:57 AM  
Joined: 2/22/2008 Last visit: 2/26/2021 Posts: 2186 Rating: (164) 
The background of my questions are different options for solutions. I have helped someone in another conference to realize an energy meter. For this i have added the power every second in an arithmetic block. If the arithmetic block exceeds the value of 3600, if have increased a counter and subtract 3600 from the arithmetic block. With this little trick you can count kWh with the full resolution. In your case it can be done in a similar way every minute and with a value of 1000 or 10000. Then the problem may be to devide the sum by n, where n is the amount of values or minutes, because the sum consist of 2 parts, the increased counter and the arithmetic block. The next problem may be a counter overflow or the values are resetted every day, month or year, this has to be checked. You have an area of 20°C to +60°C with fully centigrade or one decimal point ? That's not the same, because the Logo only work with integer values. You see, there is something to do, if you want use the Logo. Regards, Scorp P.S. For monitoring and analysis you also can use the data block, just save your temperature every minute on a SD card. Read out this card every day, week or month and use Excel for calculations. 
Last edited by: Scorp at: 01/10/2021 01:07:36 

1/10/2021 12:56 PM  
Joined: 12/3/2018 Last visit: 2/5/2021 Posts: 75 Rating: (0) 
The vaules in praxis are 200 to 550 integer. 
1/10/2021 4:50 PM  
Joined: 2/22/2008 Last visit: 2/26/2021 Posts: 2186 Rating: (164) 
See attachment for a possible solution and try to understand this principle, there are some comments at the blocks. It is also possible, that any mistake is in the program. After first start the average may be wrong, because the counter for amount is 0 at the beginning. Perhaps the program has to be expand for some options like reset or manual correction. This will be the next step, after you have checked this version. The timer is adjusted in B002, the sum of TH and TL is your intervall. For simulation you can change TL=0:90s for seconds. The sum in arithmetic block will be checked for a value greater than 9999, then 10000 are subtracted and the value counter will be increased. For the last arithmetic block, both counters must not exceed 32767, therefore this version only can be used for a "small" time period. 32767 / 24h / 60min = 22,7 days for the amount counter. The value counter has no overflow in this period with your max. value of 550. Maybe there are other versions possible with longer time periods, but this you can get from me now. Regards, Scorp AttachmentAverage2.zip (4 Downloads) 
1/10/2021 9:14 PM  
Joined: 12/3/2018 Last visit: 2/5/2021 Posts: 75 Rating: (0) 
At first, thank you very much for work on that on Sunday. If I understand you correctly, this should work for 22.7 days. Is this period calculated with the maximum temperature of 550 in mind? So, if the real temperatures are lower the working period will be longer or this have no influence? What happens after 22.7 days? The output value does not changes any more or....? It would be nice to have some sign that calculation reaches top end of resources, so one can manually reset it and start calculation from the beginning. I could live with that. OK, as you said  that is for the future improvements. Now I will add this part to the rest of the program and test it. I will test it as you suggested: with a help of data logger and Excell and then compare the results. It will take me some days, maybe a week or so. Thank you again. 
1/11/2021 5:56 AM  
Joined: 2/22/2008 Last visit: 2/26/2021 Posts: 2186 Rating: (164) 
Sure, i can make a lot of work with all comfort options needing 5060 blocks and then you say, there are only 30 blocks available. Primary you have to write the program and at least you have to read my entries completly. I have written, that the counter for the amount of measurements will exceed 32767, then the arithmetic block don't work correct. To have a sign you can use this counter output, when e.g. 32000 is reached. Then you have the time to reset some values. For this you can reset both counters, then you have a new start position. You can calculate the times for yourself. If you want measurements every minute, then devide 32767 by 60 to get hours, then devide the result by 24 to get days. If you want to increase the period time, then increase the time between 2 measurements, e.g. 2 minutes for 2x22,7 = 45,4 days and so on. Regards, Scorp P.S. As you can see in the program, the counter for amount of measurements will be only increased, when you activate the measurements, in the example with I1. The period time depends on the duty cycle, but i don't know any cycles of your system. If the activation time is only 10%, then you have 10x22,7 = 227 days. 
Last edited by: Scorp at: 01/11/2021 06:08:32 

1/11/2021 9:27 AM  
Joined: 12/3/2018 Last visit: 2/5/2021 Posts: 75 Rating: (0) 
OK, got it. The working time is normally around 1720 hours per day, so maybe I will reach a whole month. 
Follow us on