Convention: Access to Global Variable in FB_Init + FB_Exit

User Description

This convention detects a read or write access to a global variable from the FB_INIT, FB_EXIT or FB_REINIT method of a function block.

NOTE: Do not access global variables while executing these methods.
NOTE: Activate the option Consider Implicit Methods in the Configuration tab of the Code Analysis Manager to consider implicit methods during analysis. Refer to Configuration\Consider Implicit Methods.

Example

FUNCTION_BLOCK FB_TEST
VAR
END_VAR

METHOD FB_INIT: BOOL
VAR_INPUT
    bInitRetains: BOOL;
    bInCopyCode: BOOL;
END_VAR

GVL.g_iInitState := 3; // Global varible is accessed from FB_INIT