7.1. Animate the Color/Expression of an Object

About this task

If you can fill an object with a color or pattern that changes during runtime based on a condition that is specified by an expression.

The number of expressions you can define for an object is limited only by the amount of system memory available.

  • Open the Expression List Attribute Animation dialog box.
  • Configure the animation list.
  • Runtime example.

Open the Expression List Attribute Animation dialog box

Procedure

  1. Select the object that will be animated.
  2. Open the object's Properties dialog box.
  3. Select Color Animation.
  4. Click Edit in the Expression list section.

    The Expression List Attribute Animation dialog box opens.

    A first expression is available for configuration.

    Configure the animation list

    Use available options to configure the animation list.

    A Details
    B Expression list
    C Expression list buttons
    A Details

    Details that are available depend on the object selected.

    Check a detail to enable its configuration selections.

    Selections are:

    Selection Description
    Expression (Required) Condition required to display selected animation option(s); can include one or more point ID's and mathematical operators.
    ?? ?? ??
    ?? ?? ??
    Line Creates a border around the object when the expression evaluates to True.
    Line selections are:
    • Style
    • Color
    • Width
    The selected line displays when the expression evaluates to True.
    Fill Changes the object fill to the selected fill when the expression evaluates to True.
    Fill selections are:
    • Style
    • Primary color
    • (Available when a pattern or gradient two colors is selected) Second color
    • (Available when gradient one color is selected) Brightness
    Style ?? ??
    No fill ??
    Solid ??
    Pattern ?? ??
    Gradient ?? ??
    Text (Available when the object is a text object or text button.) Checked displays specified text string when the expression evaluates to True.
    Translate ?? ??
    String ?? ??
    ?? ?? ??
    Font Displays the selected font when the expression evaluates to True. Selections are.
    • Font
    • Type
    • Size
    Note: If you make the text available for translation make sure that the selected font accommodates the languages in which the string will display. Arial UNICODE MS can display all languages.
    ?? ?? ??
    Blink The object alternates the blink configuration with the line/fill configuration to create a blink effect, when the expression evaluates to True.
    Blink Rate (ms) ?? ??
    Blink Line (Enabled when Blink is checked) adds a border around the object when the blink configuration displays. This configuration alternates with the line/fill configuration to create a blink effect. Selections are line:
    • Style
    • Color
    • Width
    Blink Fill (Enabled when Blink is checked) displays the selected configuration when the blink configuration displays. This configuration alternates with the line/fill configuration to create a blink effect. Fill selections are:
    • Style
    • Primary color
    • (Available when a pattern or gradient two colors is selected) Second color
    • (Available when gradient one color is selected) Brightness
    Style ?? ??
    No fill ??
    Solid ??
    Pattern ?? ??
    Gradient ?? ??
    B Expression list

    A list of animation expressions display in the Expression box.

    The item order in this list can be changed.

    Important: Expressions in this list must be mutually exclusive. It is important to review it thoroughly to make sure there is no overlap or the animation will not work properly. The type of columns in the list depend on what object is selected.

    Example

    An expression list for a:

    • Rectangle contains line and fill specifications.
    • Text object contains text specifications.

    During runtime:

    • The listed expressions are evaluated in the order they display in the list.
    • The first condition that evaluates as TRUE or unavailable determines the object's color or text string. I
    • If no conditions evaluate to TRUE the display reverts to values configured as placeholders in the Properties dialog box.
    C Expression list buttons

    Buttons include:

    Button Description
    • Saves the expression animation list.
    • Closes the Expression List Attribute Animation dialog box.
    The Expression Count on the Color Animation tab will equal the number of expressions configured on the list.
    Cancels expression item being configured.
    Moves the selected expression item in the list.
    Up ??
    B ??
    Displays a new line at the end of the list to configure a new expression item. Once the new line is created either the:
    • Expression must be configured or
    • Item must be deleted.
    • Duplicates the selected expression.
    • Places the duplicate expression at the end of the list.
    Important: The duplicate expression must be edited in order to adhere to the requirement that expressions be mutually exclusive.
    Deletes the selected expression item.

    Runtime Example

    A button is configured to change appearance based on its configured expression in the Expression List Attribute Animation dialog box.

    The expressions use the following point.

    Point ID Class
    TANK750 Integer

    Expressions in the list are as follows.

    • AH2(TANK750)
    • AH1(TANK750)
    • AL1(TANK750)
    • AL2(TANK750)
    • NOT AL(TANK750)

    During runtime operators must press specific keys on a keypad based on a TANK750 alarm state.

    The following objects contain expression animation to alert operators and insure that they press the correct keys.

    Default Configuration AH2 Configuration AH2 Blink Configuration
    Item Description
    A Text (text object) reports what keys to press based on the alarm state expression that evaluates to True.
    B Text background (rectangle object) changes color and blinks based on the alarm state expression that evaluates to True.
    C Keys that must be pressed change color when their alarm state expression evaluates to True.
    D Text (text object) that reports the TANK750 point value changes color based on the alarm state expression that evaluates to True.