Recommended Posts

what is the best way to set formula and use it many times in our aplication...

For example...

I found somewhere formula to calculate DEW point from temperature and relative humidity from many sensors..

X= 1-(0.01*RH)
K= Tc-(14.55+0.114*Tc)*X-((2.5+0.007*Tc)*X)^3- (15.9+0.117*Tc)*X^14

 

Link to comment
Share on other sites

Do you want to apply this to a bunch of channels?  In that case, you should use a Conversion.  Replace the variable that should get the channel value with the word Value.

But I'm guessing that since you are calcing this from two channels you probably can't do that.  In that case, create a sequence that returns the result, something like:

function CalcDewPoint(Tc, Rh)

return( Tc-(14.55+0.114*Tc)*( 1-(0.01*RH) )-((2.5+0.007*Tc)*( 1-(0.01*RH) ))^3- (15.9+0.117*Tc)*( 1-(0.01*RH) )^14

Note how I replaced X with the calc.  This is faster than doing it in two lines.  Once you've created this sequence, you can calc dew point by doing:

calcDewPoint(x,y)

If you want to trend dewpoint (or log it), you probably will want to create a channel to hold the value and calculate it at some interval, then use the Event on RH or Tc to call your function and then use AddValue() on the dew point channel to stick the result into the channel.

Link to comment
Share on other sites

I was my mistake..I called function inside sequence, CalcDewPoint(Tc, Rh), so it must be sequence name like DEW_point(temco_temp[0],temco_hum[0]) in my example..

pls, see screens...

now it works, calculations should be OK

 

dew_final.JPG

dew_final_2.JPG

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.