Skip to Main Content
AVEVA Product Feedback


Status No status
Created by Guest
Created on Aug 20, 2022

Make badval() in Formula data reference equivalent to BadVal() in Analytics

Currently, BadVal() in Asset Analytics can handle situations like BadVal(1/0) without throwing a divide by zero error, but the badval() function in the Formula DR cannot. The request is to make them equivalent so that behavior is consistent across the product.
  • Attach files
  • Guest
    Reply
    |
    Aug 20, 2022
    Agree that they should behave the same. Which is the desired behavior?
  • Guest
    Reply
    |
    Aug 20, 2022
    BadVal should return TRUE if the input argument has a bad quality. So for a PIPoint DR this would be when the value is a digital state (for numeric), or digital state outside the digitalstate set, including system states. For formulas, I would expect that things such as "divide by zero", "all events filtered", "no events", "No data", "unknown attribute" etc etc would be treated as bad values. In the same way as the IFERROR function works in Excel. BadVal should do what it says it should, i.e. detect when the argument is bad. This saves a lot of defensive logic to be added to the formulas when it should be a standard function.
  • Guest
    Reply
    |
    Aug 20, 2022
    Issue documented here: https://pisquare.osisoft.com/thread/42973-badval-doesnt-detect-divide-by-zero-errors Problem with formulas is that badval(1/0) will evaluate the 1/0 first and throw a divide by zero error before badval has a chance to evaluate.
  • Guest
    Reply
    |
    Aug 20, 2022
    Thank you for your feedback.
  • jerome.boudon
    Reply
    |
    Aug 20, 2022
    Also, in ADR Badval returns True (which is for us the preferred behavior) on an event with questionnable flag active whereas in ADR, it returns False. There is no way of testing the Questionnable flag in FDR.
  • Guest
    Reply
    |
    Aug 20, 2022
    I would prefer the AA handling