Skip to main content

i4scada Knowledge Base

Application of Condition Rules

Abstract

Personalize your i4scada SmartEditor project with Condition Rules, by specifying signal names, logical operators, and values.

The scope of the Condition Rules is to define a specific state of an i4scada extension, at run-time, depending on a logical condition based on adjacent signal values.

The Condition Rules parameter is available under the States section, in the extension Object Properties panel.

Condition_Rule_parameter.jpg

Object Properties panel - the Condition Rules parameter

The Condition Rules configuration is based on a collection of settings, which depend from one extension to another:

Condition_Rule_configuration_collection.jpg

Collection of Condition Rule settings

  • Condition Rule - Allows the configuration of the condition to be met in order for a specific state to be activated. The condition rule is defined by specifying signal names, logical operators, and values. The signal names must be enclosed between percent signs (%SIGNALNAME%).

    The below table illustrates the logical operators that can be used to express condition rules:

    Logical operator symbol

    Explanation

    >

    higher

    <

    smaller

    >=

    higher or equal

    <=

    smaller or equal

    ==

    equal

    !=

    different

    &&

    and

    ||

    or

    ~

    Bit-wise NOT

    ^

    Bit-wise XOR

    &

    Bit-wise AND

    |

    Bit-wise OR

    Note

    %LocalSecond% <= 30 if a state is active at run-time: The value of the signal „Local Second“ is less or equal to 30.

    Besides logical operators, it is also possible to use the following String operations in the below table. However, the strings must be escaped in a sentence, by setting their value between a backslash and an apostrophe \'value\'.

    StringOperator

    endsWith

    startsWith

    contains

    Note

    %LocalSecond% startsWith \'2\': The value of the "Local Second" signal starts with the numerical value 2.

    Switch_displays_error_based_on_defined_condition.jpg

    Switch displays error, as the condition is now met

  • State Symbol - The name of the icon class for the current state. Depending on the used extension, there are different icons to choose from. If the "Default icon" selection is kept, the symbol that is configured outside the states will not be changed.

    This property applies to the following extensions:

    • wf-electric-symbol

    • wf-hvac-symbol

    • wf-icon

    • wf-icon-detailed

    • wf-icon-primitives

    • wf-pid-symbol

    • wf-valves-symbol

    • wf-switch-symbol

  • Style Class Name - Optional CSS class names for the style of this state - e.g. "error". Custom class names are allowed.

  • Animation - Allows the configuration of an animation style for the extension's current state, at run-time.

  • Animation Duration - Sets the duration of the animation in seconds.

  • Animation Count - Sets the amount of animation repetitions.

Warning

The preview of a Condition Rule text is limited to an amount of 258 characters. More details upon this topic can be found under the Known issues section, by reading the article Text ellipsis at "Condition Rules" object property if the Condition Rule exceeds 258 characters.