-

Safety Semantic Error: The global variable '...' is not defined.

In a local variables table of a POU, the variable mentioned in the error message is declared as external variable ('Usage = External'). The relating 'Global' declaration in the Safety PLC Data List, however, is missing.

Remedy:

Background: When declaring an external variable while editing code via the context menu of the undeclared variable, the related 'Global' declaration is automatically inserted into the Data List of the Safety PLC node provided that the respective POU is already instantiated in the Safety PLC (i.e., a program instance exists or an FB instance within a program instance). If you are editing the code of, for example, a new FB which is not yet instantiated in any other POU, this automatic insertion of the 'Global' declaration is not done (even if the external declaration is visible in the local variables table). In such a case, the 'Global' declaration must be inserted manually.