AnsweredAssumed Answered

If Statements with OR in PI Calc

Question asked by Cannon on Jan 31, 2019
Latest reply on Feb 2, 2019 by LalBabuShaik

I'm trying to make a multi-state check, that will look at a few tags and if any of them are On (state of 1) then the multi-state will throw out a 1 to show that the unit is in use. Then if all of them are off then it throws out a 0.

 

the expression I'm trying to use is as follows

IF Tag1 OR Tag2 OR tag3 = 1 then 1 else 0

 

The other way I thought I could try to make the expression work is to add the tags together (since they put out a 1 to show that they are running I thought I could add them together)

IF (Tag1 + Tag2 + Tag3) > 0 then 1 else 0

 

The problems I'm facing is the first I keep getting an evaluating error and on the second approach the values aren't actually adding together. Any help would be appreciated.

Outcomes