Skip to main content

Attribute: noinit

The pragma is applied to variables that should not be implicitly initialized.

Syntax:

{attribute 'no_init'}

{attribute 'no-init'}

{attribute 'noinit'}

Insert location: Line above the declaration line of the variables concerned in the declaration part.

Example 283. example
PROGRAM PLC_PRG
VAR
    iA : INT;
    {attribute 'no_init'}
    iB : INT;
END_VAR

When the associated application is reset, the integer variable iA is implicitly re-initialized with 0, whereas the variable iB retains its current value.