External Variables - VAR_EXTERNAL

External variables are global variables that are imported into a block.

You declare these variables between the keywords VAR_EXTERNAL and END_VAR. If the global variable does not exist, then an error message is printed.

Attention

In CODESYS, it is not necessary to declare variables as external. The keyword exists for maintaining compliance with IEC 61131-3.

Example

VAR_EXTERNAL
\ iVarExt1 : INT; (* 1st external variable *)

See also