4 output processing and nan, Crbasic example 70. using nan to filter data – Campbell Scientific CR3000 Micrologger User Manual
Page 434

Section 10. Troubleshooting
434
0 / 0
NAN
NAN
NAN
65535
2147483648
NAN
TRUE
TRUE
-2147483648
1
except Average() outputs NAN
2
except Average() outputs 0
10.3.4.4 Output Processing and NAN
When a measurement or process results in NAN, any output process with
DisableVar
= FALSE that includes an NAN measurement, e.g.,
Average(1,TC_TempC,FP2,False)
will result in NAN being stored as final-storage data for that interval.
However, if
DisableVar
is set to TRUE each time a measurement results in NAN,
only non-NAN measurements will be included in the output process. CRBasic
example Using NAN to Filter Data
(p. 434)
demonstrates the use of conditional
statements to set
DisableVar
to TRUE as needed to filter NAN from output
processes.
Note If all measurements result in NAN, NAN will be stored as final-storage data
regardless of the use of
DisableVar
.
CRBasic Example 70. Using NAN to Filter Data
'Declare Variables and Units
Public
TC_RefC
Public
TC_TempC
Public
DisVar
As Boolean
'Define Data Tables
DataTable
(TempC_Data,True,-1)
DataInterval
(0,30,Sec,10)
Average
(1,TC_TempC,FP2,DisVar)
'Output process
EndTable
'Main Program
BeginProg
Scan
(1,Sec,1,0)
'Measure Thermocouple Reference Temperature
PanelTemp
(TC_RefC,250)
'Measure Thermocouple Temperature
TCDiff
(TC_TempC,1,mV20,1,TypeT,TC_RefC,True,0,250,1.0,0)
'DisVar Filter
If
TC_TempC = NAN
Then
DisVar = True
Else
DisVar = False
EndIf
'Call Data Tables and Store Data
CallTable
(TempC_Data)
NextScan
EndProg