beautypg.com

4 output processing and nan, Figure 125: pulling edge away from panel, Figure 126: removing nuts to disassemble canister – Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 410

background image

Section 10. Troubleshooting

410 

 

 

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. 410)

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 68. 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