Creating Expression Tags

Expression Tags are driven by an expression. The expression syntax is the same as for property bindings and allows mathematical operations, references to other tags, logic operations, and more. Expression Tags cannot be written to.

With expression tags you can do a special calculation based on other tags. In this way, you can do the calculation one time and view it on any window in your project.

To create an expression tag

  1. In the Tag Browser, right-click on Tags or a folder of your choice and select New Tag > Expression Tag.

    images/download/attachments/1704429/image2015-4-8_9_6_31.png

  2. In the Tag Editor, type FtoC Expression for Name and choose Float4 for Data Type.

  3. Click on the Expression tab on the left side of Tag Editor.

  4. Type in any expression using Ignition’s Expression Language. See Expression Functions in the Appendix for information on all expression operations and functions.

    Copy in the following expression:

    (5/9) * ({[~]Refrigeration/ambientTemp} - 32)

    images/download/attachments/1704429/image2015-4-8_9_7_35.png

    If you want to use a different tag, just replace the {[~]Refrigeration/ambientTemp} tag path with any Tag of your choice.

    Note that instead of typing the referenced tag path (in this example Refrigeration/ambientTemp), you can use the Tag icon on the right side of the Tag Editor > Expression window to select the tag path.

    images/download/attachments/1704429/image2015-4-8_9_8_43.png

  5. Click OK.

    Yo u will see the value from your calculation on the Tag. Note that the Expression tags are evaluated at the rate the Scan Class is set to.

    images/download/attachments/1704429/image2015-4-8_9_9_23.png

    With an expression tag, you can also choose to write the value back to another OPC item. In the Tag Editor > Expressions, simply click the check box next to Write value back to OPC item? and select the tag you want to
    write to. Every time the value is calculated, the value gets written to the selected tag.

Creating Expression Tags

Watch the Video