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.

Max gust last hour and from which direction


Makada Aug 16, 2016 06:32 PM

Hi all,

Below is a program which calculate the max gust last every 10 minutes and from which direction.

Id also like to have it calculate every last hour gust and from which direction and running constantly like it does with the 10 minute version below...

And id like to have the ''record gust only if windspeed....removed.

I tried to remove it but the program didnt work after that...

'CR1000 Series Datalogger
'Wind gust programming example using the RM Young 05013-10 wind monitor
'Date: August 2014
'Program author: Campbell Scientific Canada
Public WindSpd
Public WindDir
Public WS2minrunavg
Public WS_10_max
Public WS_Gust
Public WS_Gust_dir
Public maxavgdif
'Declare Variable Units
Units WindSpd = m/s
Units WindDir = degrees
Units WS_Gust = m/s
Units WS_Gust_dir = degrees
'Define Output Data Tables
DataTable (TenMinute,1,1000)
DataInterval (0,10,Min,10)
WindVector (1,WindSpd,WindDir,FP2,False,0,0,0)
FieldNames ("WindSpd_AVG:Deg,WindDir_AVG:Deg,WindDir_STDEV:Deg")
Minimum (1,WindSpd,FP2,False,False)
Maximum (1,WindSpd,FP2,False,False)
SampleMaxMin (1,WindDir,FP2,False)
Maximum (1,WS_Gust,FP2,False,False)
SampleMaxMin (1,WS_Gust_dir,FP2,False)
EndTable

'Main Program
BeginProg
Scan (1,Sec,0,0)
'Generic 4-20 mA Input measurement Windskm
VoltDiff(WindSpd,1,mV2500,1,True,0,_50Hz,0.081035,-40)
'Generic 4-20 mA Input measurement Windr
VoltDiff(WindDir,1,mV2500,2,True,0,_50Hz,0.18,-89.1)
If WindDir>=360 Then WindDir=0
'Program code for outputting wind gust data as per EC MSC guidelines
AvgRun (WS2minrunavg,1,WindSpd,24)
'Resest 10 Minute Max every 10 minutes.
If TimeIntoInterval(0,10,Min) Then
WS_10_max = 0
WS_Gust = 0
WS_Gust_dir = 0
EndIf
'Record Gust only if wind speed is greater than 7.78 m/s (15 knots).
'Record the 10 Minute Max as the current gust if it exceeds the
'2 minute average by 2.5 m/s (5 knots), otherwise record it as zero.
If WindSpd >= 7.78 Then
If WindSpd >= WS_10_max Then
WS_10_max = WindSpd
maxavgdif = WS_10_max - WS2minrunavg
If maxavgdif >= 2.5 Then
WS_Gust = WS_10_max
WS_Gust_dir = WindDir
Else
WS_Gust = 0
WS_Gust_dir = 0
EndIf
EndIf
EndIf
'Call Output Data Table
CallTable TenMinute
NextScan
EndProg



'CR1000
'Declare Variables and Units
Public Batt_Volt
Public WS_ms
Public WindDir
Units Batt_Volt=Volts
Units WS_ms=meters/second
Units WindDir=Degrees
'Define Data Tables
DataTable(Table1,True,-1)
DataInterval(0,1,Sec,1)
WindVector (1,WS_ms,WindDir,FP2,False,0,0,0)
FieldNames("WS_ms_S_WVT,WindDir_D1_WVT,WindDir_SD1_WVT")
EndTable
'Main Program
BeginProg
Scan(1,Sec,1,0)
'Default Datalogger Battery Voltage measurement Batt_Volt:
Battery(Batt_Volt)
'05103-10 Wind Speed & Direction Sensor measurements WS_ms and WindDir:
'Generic 4-20 mA Input measurement Windskm
VoltDiff(WS_ms,1,mV2500,1,True,0,_50Hz,0.081035,-39.9875)
'Generic 4-20 mA Input measurement Windr
VoltDiff(WindDir,1,mV2500,2,True,0,_50Hz,0.18,-89.1)
'Over range correction calculation
If WindDir>=360 Then WindDir=0
If WindDir<0 Then WindDir=0
'Call Data Tables and Store Data
CallTable(Table1)
CallTable TenMinute
NextScan
EndProg


jra Aug 17, 2016 03:56 PM

Take a look at the SampleMaxMin() instruction and the associated example program. I think it greatly simplifies what you are trying to do. 

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