AnsweredAssumed Answered

What is wrong in this expression...

Question asked by tomy on Oct 12, 2016
Latest reply on Oct 12, 2016 by avanfosson

Hello everybody,

I need help, What is wrong in this expression:

 

if BadVal( 'TEMP.PV') then 2 else if (BadVal('HUM.PV') then 2 else if (BadVal('tag1.PV') then 2 else if (BadVal('tag2.PV') then 2 else (if BadVal('tag3.PV') then 2 else if (BadVal('tag4.PV') then 2 else if (BadVal('tag5.PV') then 2 else if (BadVal('tag6.PV') then 2 else (if 'TEMP.PV' > 27 or 'HUM.PV' > 70 or 'tag1.PV' < 1 or 'tag2.PV' < 1 or 'tag3.PV' < 1 or 'tag4.PV' < 1 or 'tag5.PV' > 90 or  'tag6.PV' > 60 then 1 else 0))

 

I might add that the error is in the underlined part of the expression...

Thanks....

 

OK, I think I found:

if BadVal( 'TEMP.PV') then 2 else if BadVal('HUM.PV') then 2 else if BadVal('tag1.PV') then 2 else if BadVal('tag2.PV') then 2 else if BadVal('tag3.PV') then 2 else if BadVal('tag4.PV') then 2 else if BadVal('tag5.PV') then 2 else if BadVal('tag6.PV') then 2 else (if 'TEMP.PV' > 27 or 'HUM.PV' > 70 or 'tag1.PV' < 1 or 'tag2.PV' < 1
or 'tag3.PV' < 1 or 'tag4.PV' < 1 or 'tag5.PV' > 90 or  'tag6.PV' > 60 then 1 else 0)

Outcomes