You are here: Start » Function Reference » All Functions » Loop Utils » TestObjectChanged

TestObjectChanged
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Header: | STD.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Checks if the input object is different than in the previous iteration.
Syntax
void fil::TestObjectChanged ( const Type& inObject, bool inInitialResult, bool inReset, bool& outObjectChanged, Type& outPreviousObject )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inObject | const Type& | ||
![]() |
inInitialResult | bool | Result of the filter at first iteration | |
![]() |
inReset | bool | False | Reset accumulator state |
![]() |
outObjectChanged | bool& | Is object changed | |
![]() |
outPreviousObject | Type& | Object from previous iteration (in first iteration equals inObject) |
Description
This filter checks if an object has changed between consecutive iterations. It is especially useful in working with I/O and allows to execute a part of an application only when some I/O data has changed. This filter can be also used as an input of macrofilter variant.
Input inInitialResult allows for setting the initial output of the filter. This is useful to force some computations at the start of application.
In first iteration output outPreviousObject is equal to value on inObject
Remarks
When working with HMI, a more recommended way of detecting changes is to use appropriate properties of HMI Controls such as TrackBar.outValueChanged.
This filter can be replaced with the following formula:

See Also
- CopyObject – Creates a copy of the input data.