Skip to content

Status Widget ​

Last updated

A colored badge or circle whose text and color come from an ordered list of rules — Running in green, Idle in amber, Fault in red.

Settings ​

SettingDescriptionDefault
ShapeBadge (pill with text) or Circle (large pulsing dot with text below)Badge
Status RulesOrdered list of conditions, each with text and a colorfive rules, below
Default Text (unmatched values)Text when no rule matchesthe raw value
Default ColorColor when no rule matchesgray

Rules ​

Each rule has a condition, a value (two for between), the text to show and a color. Click Add to add one, ▲▼ to reorder and × to remove. The first matching rule wins.

ConditionMatches when the value…
= equalsas text, is exactly the rule value. Case-sensitive: Running does not match running
≠ not equalsas text, is not the rule value
> greater than, ≥ at least, < less than, ≤ at mostis a number and compares with the rule value
↔ betweenis a number from the first to the second value, inclusive
is trueis true or 1
is falseis false, 0 or empty

If a rule's text is empty, the raw value is shown in the rule's color.

A new Status widget starts with these rules, suitable for a boolean running bit or a lower-case state string:

ConditionValueTextColor
equalstrueRunninggreen
equalsfalseStoppedgray
equalsrunningRunninggreen
equalsidleIdleamber
equalsfaultFaultred

Delete the ones you don't need. Dashboards saved with older status settings (a text map or state map) are converted to this rule list when you open them.

Editing the rules as JSON ​

Click Edit as JSON above the rules to see and edit the whole list as text, which is quicker for a long state list or one copied from another widget. Click Apply to replace the rules with what is in the box; nothing changes until you do, and Edit as rows goes back to the row editor. Two shapes are accepted:

  • The rule list itself, as shown in the box: [{"condition": "eq", "value": "1", "label": "Running", "color": "#16a34a"}]. condition is one of eq, ne, gt, lt, gte, lte, between (with value2), true or false, and defaults to eq. A missing color is blue; a missing label shows the value.
  • A state map, value to text or to text and color: {"0": "Stopped", "1": {"label": "Running", "color": "#16a34a"}, "2": "Idle"}. Each entry becomes an equals rule, in the order written, blue when no color is given.

If the text is not valid JSON, or a rule has an unknown condition, the box says why and the rules are left as they were.

Binding ​

The widget reads the binding named value.

Example: a PLC state code ​

A filler reports State as an integer. Rules:

ConditionValueTextColor
equals0Stoppedgray
equals1Runninggreen
between2 / 9Starved / Blockedamber
≥ at least10Faultred

Default Text Unknown, Default Color purple, so a state nobody planned for stands out.

See also ​

Scada.Ink Help Center