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.

10Hz anemometer and rain gauge pulse counts


Neil M. Feb 8, 2022 02:24 PM

We are having trouble simultaneously logging 10Hz RS-232 serial data from two sonic anemometers and tipping bucket rain gauge pulse counts on a CR3000 logger.

The pulse counts must be in the main scan. Initially we had a 10Hz main scan containing the pulse counts. All the other instruments and sensors (SDI and analog types) were placed in a SlowSequence. The program was not recording the rainfall accurately, it seemed to miss most of the tips.

Strangely there are also two pulse counting A100R cup anemometers in the same part of the program as the tipping buckets and the data for these looks ok. The only diference between the commands for the A100R and tipping buckets is the Pconfig which is set to High Frequency for the A100Rs and Switch Closure for the tipping buckets.

We then tried using a 20 second main scan containing the tipping bucket rain gauges and all other sensors and used a 10Hz SubScan for the anemometer data. In this instance the main scan is skipping every 3rd scan so we lose all the data including the 10Hz anemometer data for that scan.

I've pasted the relevant code from teh 20 second main scan program below.

The priority is to get the 10Hz data, everything else is only output at 15 minute intervals (average or totals).

What is the best way to combine high frequency RS232 measurements with other sensors?

BeginProg
Scan(20,Sec,1,0)
'Open Com ports for sonic anemometers
SerialOpen (Com3,19200,0,0,10000)
SerialOpen (Com4,19200,0,0,10000)
'10Hz Sonic data (as a SubScan within the main scan)
SubScan (100,mSec,200)
'Measurement of First sonic
NanErr=0
SerialInRecord(Com3,SonicStr,&h02,0,&h03,SonicBytes,01) 'Read data from Windmaster
SplitStr(SONIC(),SonicStr,",",8,5)
'Sonic error recording: Flags an error if the SonicStatus string indicates a problem with the anemometer.
disable_flag=(HexToDec(SonicStatus)<>0)
ErrDetect=StrComp (disable_flag,false)
If ErrDetect<>0 Then ErrDetect=1
' NAN error handling of sonic data: Flags and error if any of the sonic outputs are NAN.
If U=NAN Then ErrDetect=1
If V=NAN Then ErrDetect=1
If W=NAN Then ErrDetect=1
If SonicT=NAN Then ErrDetect=1
If SOS=NAN Then ErrDetect=1
If SonicStatus=NAN Then ErrDetect=1
If U=NAN OR V=NAN OR W=NAN OR SonicT=NAN OR SOS=NAN OR SonicStatus=NAN Then NanErr=1
'Measurement of Second sonic
NanErr1=0
SerialInRecord(Com4,SonicStr1,&h02,0,&h03,SonicBytes1,01) 'Read data from Windmaster
SplitStr(SONIC1(),SonicStr1,",",8,5)
'Sonic error recording
disable_flag1=(HexToDec(SonicStatus1)<>0)
ErrDetect1=StrComp (disable_flag1,false)
If ErrDetect1<>0 Then ErrDetect1=1
'NAN error handling of SONIC Data
If U1=NAN Then ErrDetect=1
If V1=NAN Then ErrDetect=1
If W1=NAN Then ErrDetect=1
If SonicT1=NAN Then ErrDetect=1
If SOS1=NAN Then ErrDetect=1
If SonicStatus1=NAN Then ErrDetect=1
If U1=NAN OR V1=NAN OR W1=NAN OR SonicT1=NAN OR SOS1=NAN OR SonicStatus1=NAN Then NanErr1=1
'Call SONIC Output Table
CallTable SonicData
NextSubScan
'
'
'////////// Sensor measurements \\\\\\\\\\
Battery(BattV)
'Default CR3000 Datalogger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_50Hz)
'
'ARG314 Tipping Bucket Rain Gauge measurement 'Rain_mm'
PulseCount(Rain_mm,1,1,2,0,0.098,0) 'ARG314 S/N: 204310, Calibration Factor = 0.098 mm per tip
'ARG100 Tipping Bucket Rain Gauge measurement 'Throughfall_mm'
PulseCount(Throughfall_mm,1,2,2,0,0.2,0) 'ARG100 S/N: 181619, Calibration Factor = 0.200 mm per tip
'A100R Wind Speed Sensor (CSL) measurement
PulseCount(A100R_WS3_ms,1,3,2,1,1.1839,0.1505) 'S/N: 1644, Rotor: FFYG y = 1.1839x + 0.1505
PulseCount(A100R_WS4_ms,1,4,2,1,1.1996,0.1363) 'S/N: 3207, Rotor FFYC y = 1.1996x + 0.1363


''Remaining program omitted for clarity

'Call Data Tables and Store Data
CallTable T1Min
If (T1Min.output(1,1)=true) Then GetRecord(Array1Min,T1Min,1) 'Place 1 minute data in array for determining automatic fumigation status and settings
CallTable MetData
CallTable FumigationData
CallTable Fumigation1Min
'
NextScan
EndProg


JDavis Feb 9, 2022 03:20 PM

Do not use a SubScan(). You will need to get both sonic measurements and all PulseCount() measurements to fit within 10Hz time of a main scan.

Make sure your program is compiling in PipelineMode. That lets the processing run in parellel with the measurements.

Keep in mind that most scans won't have any rain pulses, even when raining. Using Totalize in your data table should work out correctly.


Neil M. May 3, 2022 02:53 PM

Thanks, I think this is the same solution we arrived at :o)


StephenBurnap May 4, 2022 08:04 AM

This post is under review.

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