Attribute const_replaced, Attribute const_non_replaced
Fügen Sie das pragma {attribute 'const_replaced'}
in der Deklaration einer globalen Konstante vom Typ Skalar ein, wenn Sie die Compiler-Option für diese Konstante explizit aktivieren möchten. Dadurch wird die Konstante in der verfügbar.
Entsprechend können Sie das Pragma {attribute 'const_non_replaced'}
einfügen, um die Compiler-Option zu deaktivieren.
Die Option SoMMenu/index.htm vordefiniert.
ist für das gesamte Projekt im Dialogfeld
Die Konstanten iTestCon
und bTestCon
sind in der verfügbar, weil durch Pragmas deaktiviert wird.
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