The problem de jour is taking an existing tag, and testing for a particular quality value with an Ignition expression.
With the expression function library, I can use the qualityOf
function to pull out just the QualityCode value. At the moment, I am only successfully able to test against this quality code with the integer value representation - which is workable, just cryptic.
For instance, if I want to return different values based off of the quality code using a case
statement, I would write that as:
case(qualityOf({<tag_path>}), -2147483124, "Out of range!", "")
Ideally, I’d like to have the enumerated value used in this case
statement for better readability when combining many quality codes into a single case
statement, like so:
case(qualityOf({<tag_path>}), QualityCode.Bad_OutOfRange, “Out of range!”, “”)
I understand it is also possible to dive into a Python script and expose quality codes via an import: from com.inductiveautomation.ignition.common.model.values import QualityCode
I am trying to avoid using a script for this logic for performance reasons.
Thank you,
- Paul