Attribute 'call_on_type_change'

The pragma is used to identify a method of a function block A, which is to be called as soon as the data type of a function block B, C, ... referenced by A changes. The referencing can be defined by a pointer variable or by a variable of type REFERENCE. You define the function blocks referenced by A whose type change is to trigger the method call in the attribute value.

Syntax:

{attribute 'call_on_type_change':= '<name of the first referenced function block>, <name of the second referenced function block>, <name of the ... referenced function block>'}

Insertion location: Line above the first line in the declaration of the method

Example:

Function block with references:

FUNCTION_BLOCK FB_A
...
VAR
    pVar   : POINTER TO FB_B;
    refVar : REFERENCE TO FB_C;
END_VAR

Method for responding to a type change in the references FB_B and FB_C:

{attribute 'call_on_type_change' := 'FB_B, FB_C'}
METHOD METH_react_on_type_change : INT
VAR_INPUT