|
No initialization code during a fast online change |
|---|---|
|
Since compiler version >= 3.5.0.0, a "fast online change" is performed for minor changes. During a fast online change, only the modified POUs are compiled and downloaded. In particular, no initialization code is generated. For variables with the However, to make sure of the impact of the For more information, see: Build |
The effect of this pragma is that the variable to which the pragma is applied is initialized with each online change.
Syntax:
{attribute 'init_on_onlchange' }
Insert location: The line above the line with the declaration of the variables.
Example 273. Example
VAR_GLOBAL
{attribute 'init_on_onlchange'}
g_fastOnlineChange : BOOL := FALSE;
END_VAR
{attribute 'call_after_online_change_slot' := '4567'}
FUNCTION FUNC_OnlineChangeDetection : BOOL
VAR_INPUT
END_VAR
VAR
END_VAR
IF GVL_OnlineChangeDetection.g_fastOnlineChange THEN
// here you know that you are inside a FastOnlineChange
END_IF
// reset for next detection
GVL_OnlineChangeDetection.g_fastOnlineChange := TRUE;