Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

10 minutes Max ws running average


Arie H. Aug 13, 2024 09:07 AM

I wrote a program that performs a running average of wind speed, every minute. Sampling is every 2 seconds for a total of 30 samples per minute. At the end of 10 minutes, 10 values ​​were received and I want to get the highest running minute in those 10 minutes, to a table. 10 minutes later the same action will be performed again. How to perform?

Const ws_BUF = 30

Public ws_1(ws_BUF), I1
Public ws_1mn_avg
Public WS

'\\\\\\\\\\\\\\\\\\\\\\\\ OUTPUT SECTION ////////////////////////

DataTable(Table001,true,-1)
DataInterval(0,1,Min,-1)
Average(1, WS, FP2, 0)
EndTable

DataTable(Table110,true,-1)
DataInterval(0,10,Min,-1)
Maximum(1, ws_1mn_avg, FP2, 0, True)
EndTable

'\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ////////////////////////////

BeginProg
Scan(2,sec,3,0)

'*******************************************
PulseCount(WS, 1, P1, 5, 1, 0.098, 0)
For I1=2 To ws_BUF
ws_1(I1-1)=ws_1(I1)
Next I
ws_1(ws_BUF)=WS
AvgRun (ws_1mn_avg, 1, WS ,30)
'*******************************************

CallTable Table110
CallTable Table001
NextScan
EndProg

Log in or register to post/reply in the forum.