EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers.

User-Defined Attributes

Overview

You can assign arbitrary user-defined or application-defined attribute pragmas to POUs, type declarations, or variables. This attribute can be queried before compilation by conditional pragmas.

Syntax

{attribute 'attribute'}

This pragma instruction is valid for the subsequent POU declaration or variable declaration.

You can assign a user-defined attribute to:

oa POU or action

oa variable

oa data type

Example on POUs and Actions

Attribute vision for function fun1:

{attribute 'vision'}
FUNCTION fun1 : INT
VAR_INPUT
i : INT;
END_VAR
VAR
END_VAR

Example on Variables

Attribute DoCount for variable ivar :

PROGRAM PLC_PRG
VAR
{attribute 'DoCount'};
ivar:INT;
bvar:BOOL;
END_VAR

Example on Types

Attribute aType for data type DUT_1:

{attribute 'aType'}
TYPE DUT_1 :
STRUCT
a:INT;
b:BOOL;
END_STRUCT
END_TYPE

For the usage of conditional pragmas, refer to the chapter Conditional Pragmas.