Temporary Variable - VAR_TEMP

This functionality is an extension with regard to the IEC 61131-3 standard.

Temporary variables are declared locally between the keywords VAR_TEMP and END_VAR.

VAR_TEMP declarations are only possible in programs and function blocks.

TwinCAT reinitializes temporary variables each time the function block is called.

The application can only access temporary variables in the implementation part of a program or function block.

Example:

VAR_TEMP
    nVarTmp1 : INT; //1st temporary variable
END_VAR