Skip to main content
Version: V2 (Ignition 8.1)

Expression Editor

Overview

The Expression Editor is a custom Perspective component that provides an enhanced interface for creating and editing Ignition expressions. It lets users bind an expression field to a PLC tag and transform its value with calculations using the Ignition Expression Language, with syntax highlighting, tag insertion, a live evaluated result, and error checking. It is used throughout Tamaki MES wherever a value can be driven by a tag or expression - for example the state, mode, downtime-reason, count, and rate expressions on the OEE Configuration screen.

Expression editor showing its evaluate result and the operator, formula, and tag-browser toolbar

Interface

  • Text entry area - where the expression is typed. It can be populated automatically by the Browse Tags button, and edited freely to build more complex logic and calculations.
  • Result line - shows the live evaluated result of the expression, or an error if it is invalid.
  • Toolbar (to the right of the editor):
    • Operators Button (+=) - opens an Operators menu (Mathematical, Logical, and Bitwise) whose entries are inserted into the text entry area at the cursor:

      Operators menu showing Mathematical, Logical, and Bitwise categories

    • Formulas Button (Σ) - opens a Formulas menu of built-in functions grouped by category (Advanced, Aggregates, Alarming, Colors, Date and Time, JSON, Logic, Math, Strings, Translation, Type Casting, Users):

      Formulas menu showing built-in function categories

    • Browse Tags Button - opens the Browse Tags modal to select a PLC tag to insert:

      1. The top dropdown selects the tag provider; the tree below navigates the tags in that provider.
      2. To insert a tag, select it and click Confirm, or double-click it.

      Browse Tags modal with a provider dropdown, filter box, and hierarchical tag tree

Example: bind an expression field to a PLC tag

  1. Click the Browse Tags button on the right of the expression field.
  2. In the Browse Tags modal, navigate to the desired tag (for example a location's mode or state tag) and select it.
  3. Click Confirm to insert the tag path into the editor. The Result line updates to show the tag's live value, confirming the binding.

Props

The Expression Editor component has the following props:

Prop NameTypeDescriptionInput/Output
expressionstringThe current Expression.Both
isValidbooleanIndicates whether the current expression is valid.Output
showOperatorsButtonbooleanIf true, shows a button to insert operators into the expression.Input
showFunctionsButtonbooleanIf true, shows a button to insert functions into the expression.Input
showTagBrowserButtonbooleanIf true, shows a button to insert tags into the expression.Input
cursorIndexnumberThe current cursor index in the expression.Output
expressionResultanyThe result of the expression, if it is valid.Output

Events

The Expression Editor component emits the following events:

Event NameDescriptionPayload
onOpenTagBrowserEmitted when the user clicks the "Insert Tag" button.None

Notes

  • The Expression Editor is designed to be used in conjunction with the TamakiMES/_components/ExpressionInput Perspective View, which provides a complete interface for editing expressions, including a label, description, and error messages.
  • For expression syntax, refer to the Ignition Expression Language documentation.