External variables

Global variables which are to be imported into the POU are designated with the keyword EXTERNAL. They also appear in the Watch window of the declaration part in Online mode.

If the VAR_EXTERNAL declaration does not match the global declaration in every respect, the following error message appears: “Declaration of ‘<var>’ does not match global declaration!”

If the global variable does not exist, the following error message appears: “Unkown global variable: ‘<var>’!”

Example:

VAR EXTERNAL
 iVarExt1:INT:=12; (* 1st external variable *)
END_VAR