Attribute ‘obsolete’ΒΆ

The effect of this pragma is that a defined warning is displayed for a data type definition during compilation if the data type (structure, function block, etc.) is used in the project. This enables you, for example, to draw attention to the fact that a data type is no longer valid because, for example, an interface has changed and this should also be implemented in the project.

In contrast to a message pragma this warning is defined centrally for all instances of a data type.

Syntax:

{attribute 'obsolete' := 'user defined text'}

Insertion position: line of the data type definition or in a line above it.

Example

The pragma is inserted in the definition function block fb1:

{attribute 'obsolete' := 'datatype fb1 not valid!'}
FUNCTION_BLOCK fb1
VAR_INPUT
 i:INT;
END_VAR

If you use fb1 as a data type, for example in fbinst:fb1, the following warning will be displayed when compiling the project: “datatype fb1 not valid”.

See also