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

Attribute init_namespace

Overview

A variable of type STRING or WSTRING, which is declared with the pragma {attribute init_namespace} in a library, will be initialized with the current namespace of that library. For further information, refer to the description of the library management.

Syntax

{attribute 'init_namespace'}

Example

The function block POU is provided with all necessary attributes:

FUNCTION_BLOCK POU
VAR_OUTPUT
{attribute 'init_namespace'}
myStr: STRING;
END_VAR

Within the main program PLC_PRG an instance fb of the function block POU is defined:

PROGRAM PLC_PRG
VAR
fb:POU;
newString: STRING;
END_VAR
newString:=fb.myStr;

The variable myStr will be initialized with the current namespace, for example MyLib.XY. This value will be assigned to newString within the main program.