Skip to main content
Version: 8.1

hasChanged

This function is used by Ignition's Expression language.

Description​

note

This function is only available in Transaction Group Expression Items and Expression Tags.

This function returns true if the given value has changed since the last time the Expression Item was run. Setting the optional boolean argument "include quality" to true means a quality change will make this function return true.

Syntax​

hasChanged(value, [includeQuality], [pollRate])

  • Parameters

    • Object value - The number value to check for change

    • Boolean includeQuality - A flag that indicates if a quality change will also trigger this Tag. [optional]

    • Integer pollRate - The poll rate in milliseconds. Only applicable on Expression Tags when the Execution Mode is set to Event Driven. All other Execution Modes will ignore this parameter. [optional]

      caution

      The pollRate argument was not present in Ignition 7, but is required in Ignition 8.1 and higher for Event Driven Expression Tags. This means that any Expression Tags that are in the Event Driven Execution mode will either need to have the Execution mode changed or the poll rate added in on upgrade to 8.1 or higher, or the function will run once when the value changes and then will not work properly again.

  • Results

    • Boolean - True if the value has changed since the last time the expression was evaluated, False if not.

Examples​

Code Snippet
hasChanged({[default]Station 1/Status},True) //Would return true if the referenced Tag has changed in value or quality since the last group execution.