With rules you can change widget properties dynamically. A widget property value will change along with the boolean expression status or input PV value. The execution of a rule is triggered by its input PV(s), so at least one trigger PV is needed for a rule.
For more complex dynamic behavior you will need to use scripts.
The “Boolean Expression” is JavaScript boolean expression, so all JavaScript operators are applicable here. All input PVs of the rule are accessible in the expression.
Numeric double values are referenced using the syntax pv{index}, e.g. pv0 > pv1.
Numeric long and integer values are referenced using the syntax pvInt{index}, e.g. pvInt0 > pvInt1.
String values are referenced using the syntax pvStr{index}, e.g. pvStr0 == “apple”.
A PV severity value is referenced using the syntax pvSev{index}, e.g. pvSev0 == 1. Severity values are:
- -1 - Invalid
- 0 - OK
- 1 - Major
- 2 - Minor
In addition to outputting a constant value to the property based on the boolean expression value, you may also output an expression value to the property. For example, if you want use the string value of a PV as the URL of a web browser widget, you can set the output expression to pvStr0. If you want to skip the boolean expression, simply set boolean expression to true.