Attribute obsolete

Overview

You can add an obsolete pragma to a data type definition in order to cause a user-defined alert during a build, if the respective data type (structure, function block, and so on) is used within the project. Thus, you can announce that the data type is not used any longer.

Unlike a locally used message pragma, this alert is defined within the definition and thus global for all instances of the data type.

This pragma instruction is valid for the current line or - if placed in a separate line - for the subsequent line.

Syntax

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

Example

The obsolete pragma is inserted in the definition of function block fb1:

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

If fb1 is used as a data type in a declaration, for example, fbinst: fb1; the following alert will be dumped when the project is built:

'datatype fb1 not valid'