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.

Conditional statements in PipeLine mode


kjchutko77 Jul 29, 2021 08:48 PM

I'm trying to add a Geonor T200B precip gauge to an existing met station. Logger is CR1000. The arrangement of existing sensors requires me to run the program in Pipeline mode. To control the T200B, I can use PeriodAvg or PulseCount, but they are used inside a conditional statement which allows the sensor to warm up before measuring. But, PeriodAvg and PulseCount cannot be inside a conditional statement in PipeLine mode. Is there a workaround?

If TimeIntoInterval (25,30,Min) Then 'set flag to true to power on and measure T200B 5 mins before top/bottom of hour
  T200B_Flag = true
EndIf
If T200B_Flag = true Then 'power on sensor
  SW12(1)
  T200B_Warmup = Timer (1,Sec,0)
  If T200B_Warmup >= 15 Then '15 sec warmup delay
    PeriodAvg (T200B_Freq,1,mV250,T200B_SE_Input,0,1,1000,1000,1,0)
    T200B_Depth_Raw = (T200B_A * (T200B_Freq - T200B_f0) + T200B_B * (T200B_Freq - T200B_f0)^2) * 10
    CallTable T200B_Processing
  EndIf
  Else
    SW12(0) 'power off sensor
    T200B_Warmup = Timer(1,Sec,3) 'reset timer
EndIf
If TimeIntoInterval (0,30,min) Then
  T200B_Flag = false
  GetRecord (T200B_Processing_30min,T200B_Processing,1)
EndIf


nsw Aug 4, 2021 11:06 AM

As you need to put the PeriodAvg in the main part of the scan and not in a conditional statement, it will happen every time the scan runs. Thats fine, but you just need to change your logic so that you only use the values measured at the times you want.

Create another value(s) which get updated only when the sensor is on, i.e. in your case, 5min before top and bottom of the hour. Then use those values in your output table. 

With a bit of experimentation, this should work for you.

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