Hi,

I have written a performance equation to show me if two tags are showing a certain value or not. For example, show true if either is ok, else show failed if one of them has failed.

So, my equation looks like this:

IF TagVal(tag1, '*')="OK" OR TagVal(tag2, '*') = "OK" THEN "OK" ELSE "FAILED"

tag 1 actually has the current value of failed, and tag 2 shows as ok. But when I evaluate this equation the value shows as OK, not FAILED.

Can anyone see where I am going wrong?

Thanks

@Jamie: There is nothing wrong in the syntax you have written. The answer might come from the triggering process. Is the calculation triggered naturally following the input of one the point or is it clock-based?

If your points (tags) are not coming from the same data source and/or the same scan class (frequency of acquisition or sampling), a natural scheduling might cause to wrongly evaluate the result of your equation as you get because when the calculation is triggered, both fresh discrete value and interpolated discrete value (using the past one) will be used.

A clock-based PE calculation will minimize the chance that one of the points has "old" value. You can also modify your equation to verify how old is the value returned by TagVal function; and if it is more than

nseconds (or minutes, or hours) you write another discrete value such as "Calc Failed" or "I/O Timeout".