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.

A question about windvector instruction


cafeilde Nov 22, 2013 02:17 AM

When the windvector has a flag for disable variable, the wind direction standard deviation can not be calculated.

Here is the program i tested. You can try.
'CR1000 Series Datalogger

Public PTemp, batt_volt
Const ws1=2.000
Const ws2=5.000
Const wd1=350.1
Const wd2=250.1
Public wd,ws
Public n=1


Public flag1 As Boolean
Public flag2 As Boolean

DataTable (Test,1,1000)
DataInterval (0,5,Sec,10)
Minimum (1,batt_volt,FP2,0,False)
Average (1,PTemp,FP2,flag2)
WindVector (1,ws,wd,FP2,flag2,0,0,0)
EndTable

DataTable (Test1,1,1000)
DataInterval (0,5,Sec,10)
Average (1,PTemp,FP2,False)
WindVector (1,ws,wd,FP2,False,0,0,0)
EndTable

BeginProg
Scan (100,mSec,0,0)
PanelTemp (PTemp,250)
Battery (batt_volt)
n=n+1

If n MOD 2=0 Then
wd=wd1
ws=ws1
ElseIf n MOD 2 = 1 Then
wd=wd2
ws=ws2
EndIf

CallTable Test
CallTable Test1

flag2 = true
If flag1 Then
flag1 = false
flag2 = false
EndIf
NextScan

SlowSequence
Scan (1,Sec,3,0)
n=n+1
flag1 = true
NextScan
EndProg

Is that a bug?
Hope for your reply!
Thanks!


Sam Nov 22, 2013 06:28 PM

Thank you for the report. I've narrowed it down to StdDev not being calculated when the disable variable is true during output to final storage but not necessarily during the rest of the data interval. We are looking into what is going on and will report back soon.

Here is the program I used to characterize the behavior for Engineering here:

Public wd,ws
Public DisableVar2 As Boolean
Public DisableVar3 As Boolean
Public DisableVar4 As Boolean

DataTable (Test1,1,1000)
DataInterval (0,5,Sec,10)
WindVector (1,ws,wd,FP2,False,0,0,0)
EndTable

DataTable (Test2,1,1000)
DataInterval (0,5,Sec,10)
WindVector (1,ws,wd,FP2,DisableVar2,0,0,0)
EndTable

DataTable (Test3,1,1000)
DataInterval (0,5,Sec,10)
WindVector (1,ws,wd,FP2,DisableVar3,0,0,0)
EndTable

DataTable (Test4,1,1000)
DataInterval (0,5,Sec,10)
WindVector (1,ws,wd,FP2,DisableVar4,0,0,0)
EndTable

BeginProg
Scan (100,mSec,0,0)

wd = RND * 180
ws = RND * 50

'disable variable for test2
If TimeIntoInterval (2,5,Sec) Then DisableVar2 = TRUE
If TimeIntoInterval(3,5,Sec) Then DisableVar2 = FALSE

'disable variable for test3, spans output to final storage
If TimeIntoInterval (4,5,Sec) Then DisableVar3 = TRUE
If TimeIntoInterval(1,5,Sec) Then DisableVar3 = FALSE

CallTable Test1
CallTable Test2
CallTable Test3
CallTable Test4

'disable variable for test4, spans entire data interval
If Test4.Output Then
DisableVar4 = NOT DisableVar4
EndIf

NextScan
EndProg


cafeilde Nov 23, 2013 03:09 AM

Thans! Sam.
Hope for your reply!


Sam Nov 25, 2013 11:59 PM

A fix will be included in the next OS release. It looks like this behavior has been in the OS for a really long time. Thank you for reporting it.

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