EcoStruxure Machine Expert Version 1.1 unterstützt nicht die Controller M258, LMC058 und LMC078.

Attribute const_replaced, Attribute const_non_replaced

Überblick

Fügen Sie pragma {attribute 'const_replaced'} in die Deklaration einer globalen Konstante ein, wenn Sie für diese Konstante explizit die Compiler-Option Konstanten ersetzen aktivieren möchten. Dadurch steht die Konstante in der Symbolkonfiguration zur Verfügung.

Entsprechend können Sie das Pragma {attribute 'const_non_replaced'} einfügen, um die Compiler-Option Konstanten ersetzen zu deaktivieren.

Die Option Konstanten ersetzen wird für das gesamte Projekt unter Projekteinstellungen > Compiler-Optionen (Dialogfeld) vordefiniert.

Syntax

{attribute 'const_replaced'}

{attribute 'const_non_replaced'}

Beispiel

Die Konstanten iTestCon und bTestCon sind in der Symbolkonfiguration verfügbar, da Konstanten ersetzen durch Pragmas deaktiviert ist.

VAR_GLOBAL CONSTANT
    {attribute 'const_non_replaced'}
    iTestCon    :    INT  := 12;    
    {attribute 'const_non_replaced'}
    bTestCon    :    BOOL := TRUE;
    rTestCon    :    REAL := 1.5;
END_VAR

VAR_GLOBAL
    iTestVar    :    INT  := 12;    
    bTestVar    :    BOOL := TRUE;
END_VAR