Expressions
Drive visibility, lit state and enablement from signal values.
An expression is a small formula evaluated continuously against live signal values. Wherever the HMI needs a yes-or-no answer about the machine, it asks an expression:
- whether a Button reads as lit, and whether it is disabled
- which Indicator state is showing
- whether an alarm is active
- whether a control is visible at all
Reference a tag with braces: {clamp_closed}.
Syntax
Section titled “Syntax”| Kind | Operators |
|---|---|
| Comparison | == != < <= > >= |
| Logic | && || ! |
| Arithmetic | + - * / |
Values are numbers, strings in double quotes, and true / false. Parentheses
group as usual.
{part_present} && !{estop_op}
{cycle_count} >= 500
{active_program} != "" && {robot_running} == falseA digital signal reads as true or false directly, so {part_present} and
{part_present} == true are equivalent.
Where an expression’s value goes
Section titled “Where an expression’s value goes”Nothing about an expression writes to the machine. A disabled expression stops a button being pressed; it does not stop the underlying signal from being written by something else.
An expression that fails to compile is treated as false at runtime and reported in the Validation panel.
An expression referencing a tag that does not exist is a warning rather than an error, because a document is often authored before every signal is mapped.
Evaluation
Section titled “Evaluation”Expressions are evaluated whenever a referenced value changes, and once when the screen connects — so a condition already true at startup is true immediately rather than waiting for the next change on the wire.
Related
Section titled “Related”- Tags — declaring the names an expression references.
- System values — built-in values usable in expressions.
- Indicator — the control most driven by expressions.