Campbell Scientific CSAT3 CSAT3 3-D Sonic Anemometer - Page 36

Example EDLOG Datalogger Program

Page 36 highlights

CSAT3 Three Dimensional Sonic Anemometer 'Break up the four CSAT3 warning flags into four separate bits. diag_csat_work = diag_csat del_T_f = diag_csat_work AND &h8000 sig_lck_f = diag_csat_work AND &h4000 amp_h_f = diag_csat_work AND &h2000 amp_l_f = diag_csat_work AND &h1000 'Turn on the intermediate processing disable flag when any CSAT3 warning flag is 'high, including the special cases NaN (61502), a Lost Trigger (61440), No Data '(61503), an SDM error (61441), or wrong CSAT3 embedded code (61442). disable_flag_on(1) = diag_csat_work AND &hf000 'Turn on only when CSAT3 diagnostic warning flags are set. disable_flag_on(2) = ( disable_flag_on(1) AND NOT (Ts = NaN) ) 'Save the four most significant bits of the CSAT3 diagnostics, except for the 'special cases NaN (61502), a Lost Trigger (61440), No Data (61503), an SDM 'error (61441), or wrong CSAT3 embedded code (61442). If ( diag_csat_work < &hf000 ) Then ( diag_csat = INT (diag_csat_work/&h1000) ) 'Compute the online wind vector statistics. CallTable wnd_vec If ( wnd_vec.Output(1,1) ) Then GetRecord (wnd_out(1),wnd_vec,1) 'Compass wind direction will be between 0 and 360 degrees. wnd_dir_compass = (wnd_dir_compass+CSAT3_AZIMUTH) MOD 360 'CSAT3 wind direction will be between 0 to 180 degrees and 0 to -180 degrees. If ( wnd_dir_csat3 ) > 180 Then ( wnd_dir_csat3 = wnd_dir_csat3-360 ) EndIf CallTable stats NextScan EndProg 10.7 Example EDLOG Datalogger Program In the following example, a CR23X is used to collect data from the CSAT3 using SDM communications. The CR23X will trigger each wind measurement over the SDM bus and retrieve the data. 28

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72

CSAT3 Three Dimensional Sonic Anemometer
'Break up the four CSAT3 warning flags into four separate bits.
diag_csat_work = diag_csat
del_T_f = diag_csat_work AND &h8000
sig_lck_f = diag_csat_work AND &h4000
amp_h_f = diag_csat_work AND &h2000
amp_l_f = diag_csat_work AND &h1000
'Turn on the intermediate processing disable flag when any CSAT3 warning flag is
'high, including the special cases NaN (61502), a Lost Trigger (61440), No Data
'(61503), an SDM error (61441), or wrong CSAT3 embedded code (61442).
disable_flag_on(1) = diag_csat_work AND &hf000
'Turn on only when CSAT3 diagnostic warning flags are set.
disable_flag_on(2) = ( disable_flag_on(1) AND NOT (Ts = NaN) )
'Save the four most significant bits of the CSAT3 diagnostics, except for the
'special cases NaN (61502), a Lost Trigger (61440), No Data (61503), an SDM
'error (61441), or wrong CSAT3 embedded code (61442).
If ( diag_csat_work < &hf000 ) Then ( diag_csat = INT (diag_csat_work/&h1000) )
'Compute the online wind vector statistics.
CallTable wnd_vec
If ( wnd_vec.Output(1,1) ) Then
GetRecord (wnd_out(1),wnd_vec,1)
'Compass wind direction will be between 0 and 360 degrees.
wnd_dir_compass = (wnd_dir_compass+CSAT3_AZIMUTH) MOD 360
'CSAT3 wind direction will be between 0 to 180 degrees and 0 to -180 degrees.
If ( wnd_dir_csat3 ) > 180 Then ( wnd_dir_csat3 = wnd_dir_csat3-360 )
EndIf
CallTable stats
NextScan
EndProg
10.7 Example EDLOG Datalogger Program
In the following example, a CR23X is used to collect data from the CSAT3
using SDM communications.
The CR23X will trigger each wind measurement
over the SDM bus and retrieve the data.
28