I'm trying to program my CR3000 to measure the wind with an anemometer Gill HS50 by rs232 and a CR3000. The frequency of acquisition is 20HZ.
But with my program, I have a problem with the anemometer.Few data recorded for the Sonic series on the port are NAN every 30 minutes. I think is a problème with a buffer.
Any help is appreciated.
'CR3000 Series Datalogger
'To create a different opening program template, type in new
'instructions and select Template | Save as Default Template
'program author:Fred Bornet
' Par rapport v2 j'ai change le format des donnees dans la table (j'ai remplace fp2
'par Rapport v2 j'ai change LI7200 (CO2,1,5,2) par LI7200 (CO2_dry,1,5,2)
' car co2dry est le premier de la liste (irga (10))
'Declare Public Variables
Alias IRGA(1)= CO2_dry
Alias IRGA(2)= H2O_dry
Alias IRGA(3)= CO2
Alias IRGA(4) = H2O
Alias IRGA(5) = AGC
Alias IRGA(6) = Ptotal
Alias IRGA(7) = Tin
Alias IRGA(8) = Tout
Alias IRGA(9) = TAvg
Alias IRGA(10) = Aux
Units CO2_dry = umol/mol
'v4 changement d'unite pour h2o_dry
Units H2O_dry = mmol/mol
Units CO2 = mmol/m3
Units H2O = mmol/m3
Units Ptotal= kPa
Units PTemp = C
Units batt_volt = C
Public PTemp, batt_volt
public toto as string * 100
units sonic_u = m/s
units sonic_v = m/s
units sonic_w = m/s
units sonic_t = C
'Declare Other Variables
dim sonic_string as string * 100
dim sonic_sub_string(7) as string * 8
dim socket as Long
'CONST PI = 3.141592654
'Define Data Tables
'plus enregistrer dans la v5
'changer ieee4 par fp2 dans la v6
'inserer dans la v5
'fin insersiondans la v5
'changer ieee4 par fp2 dans la v6
'Changement tx et buffer size suivant program daniel
'Fin modif version v7
' v4 mise a 0 des variables avnt chaque scan
' Move (CO2,5,nan,5)
'v4 changement de valeur du dernier parametre passage a 01
How fast is the sonic programmed to output its data?
RS232 115000 baud. Is it your question ?
No. Form you program it looks like you are just picking up data from the sensor, which has been preprogrammed to output data at a given rate, e.g. 20 Hz. Can you confirm how frequently the sensor is setup to output data?
the characteristics of the instruments are the following
Data output rates up to 50s-1.
• Measurement of wind velocities in excess of 30ms-1 .
• Wind speed accuracy < 1% RMS.
• Accurate speed of sound measurement.
• Configuration carried out via serial port and stored in non-volatile memory.
• High speed, full duplex RS422 interface, operating up to 115200 baud.
• Background diagnostics providing the user with the confidence that the unit is operating correctly.
• 6 differential 14 bit analogue inputs and one PRT100 input.
• Analogue outputs representing wind speed, SoS, and temperature optionally fitted in PCI.
An other information about the rates:
Wind velocity, SoS and analogue inputs are sampled every 10ms, in a fixed sequential pattern. The PRT100 is sampled every 40ms. The measurement sequence is shown in Drawing Number 1210-K-068.
You are quoting the base specs of the sensor. What you need ot know is how often the sensor is set to transmit data out of its serial port (this is configurable I believe).
For the system to work it needs to be set to output at faster than 20 Hz - perhaps 50 Hz, because otherwise you will risk loosing the occasional set of values due to slight differences in the clocks of the two systems and also you will get poor synchony of the wind data to other measurements as (at 20 Hz) there could be +/-50 ms relative jitter on the time the wind was measured relative to the other sensors.
There is one significant error in the program which could be making your system perform badly anyway and this is you have Serialflush called at the start of every scan. This will be clearing the serial buffer when data could be coming in from the sensor at that exact time. Serialinrecord alone is all you need as it manages the buffer in its own right.
Thank you for your reponse.
When I call instruction serialflush all my recordings of sonic are NAN.
Yes I would expect that but I see it was commented out in the program above - hard to see on my screen in this format.
So I would go back and check how often the sensor has been configured to output data and up the rate to 50 Hz if possible.