Hello there,

I've a problem with a Logical Expression in order to set a value taking in account a measured value.

1*R(“R_DIRV~ohm”,=141CV,FF3)

140cv=(141cv>=29700)OR(141cv<=36300)?0: (141cv>=5913)OR(141cv<=7384)?22.5: (141cv>=7385)OR(141cv<=10000)?45: (141cv>=790)OR(141cv<=936)?67.5: (141cv>=950)OR(141cv<=1050)?90: (141cv>=654)OR(141cv<=789)?112.5: (141cv>=1806)OR(141cv<=2670)?135: (141cv>=1051)OR(141cv<=1805)?157.5: (141cv>=3521)OR(141cv<=5912)?180: (141cv>=2671)OR(141cv<=3520)?202.5: (141cv>=15060)OR(141cv<=17600)?225: (141cv>=11421)OR(141cv<=15061)?247.5: (141cv>=92452)?270: (141cv>=37908 )OR(141cv<=50000)?292.5:140CV

140CV=(141cv>=58410)OR(141cv<=92450)?315: (141cv>=19692)OR(141cv<=24068 )?337.5:-999

Well, at first I had all of this in one line, but then I've noticed that the code line in DT80 has a lenght limit and I divided it (probably not the best way).

This resistance measurement is a cheap wind direction sensor (22.5º resolution) and therefore I would like to set the direction taking in account the measured resistance values. However, 140CV allways assumes the first condition and ignores the following ones. Besides the resistance value corresponding to 112.5 (654<=direction<=789) it is allways set as 0º.

what I'm missing here? can this be simplified?

Thanks for the help.

Hello there,
I've a problem with a Logical Expression in order to set a value taking in account a measured value.
1*R(“R_DIRV~ohm”,=141CV,FF3)
140cv=(141cv>=29700)OR(141cv<=36300)?0: (141cv>=5913)OR(141cv<=7384)?22.5: (141cv>=7385)OR(141cv<=10000)?45: (141cv>=790)OR(141cv<=936)?67.5: (141cv>=950)OR(141cv<=1050)?90: (141cv>=654)OR(141cv<=789)?112.5: (141cv>=1806)OR(141cv<=2670)?135: (141cv>=1051)OR(141cv<=1805)?157.5: (141cv>=3521)OR(141cv<=5912)?180: (141cv>=2671)OR(141cv<=3520)?202.5: (141cv>=15060)OR(141cv<=17600)?225: (141cv>=11421)OR(141cv<=15061)?247.5: (141cv>=92452)?270: (141cv>=37908 )OR(141cv<=50000)?292.5:140CV
140CV=(141cv>=58410)OR(141cv<=92450)?315: (141cv>=19692)OR(141cv<=24068 )?337.5:-999
Well, at first I had all of this in one line, but then I've noticed that the code line in DT80 has a lenght limit and I divided it (probably not the best way).
This resistance measurement is a cheap wind direction sensor (22.5º resolution) and therefore I would like to set the direction taking in account the measured resistance values. However, 140CV allways assumes the first condition and ignores the following ones. Besides the resistance value corresponding to 112.5 (654<=direction<=789) it is allways set as 0º.
what I'm missing here? can this be simplified?
Thanks for the help.