In the declaration part of a program, function block, method, or function, input variables can be defined. When objects of this type are called, input values must be specified. When a method or a function is called, the input values are copied to the stack. These values (memory area) are only used by the method or function call.
Compared to programs where exactly one instance exists in memory (or function blocks which are instantiated multiple times in memory), the programs or function blocks can be called multiple times, by multiple tasks, and the same memory location for the input variable is used (in parallel).
For application execution stability, the input variable should not be read from outside the program or function block.
Each read access to an input variable from outside the function block (body) or program (body) implementation itself is reported as convention violation.
SR_Main
VAR
fbTest: FB_Test;
END_VAR
// call of FB method without calling FB (Body) before
fbTest.Meth();
FB_Test
VAR_INPUT
i_lrCurrentAxisPosition: LREAL;
END_VAR
METHOD Meth()
VAR
i_lrVar1: LREAL;
END_VAR
// potential access to not properly initialized variable
i_lrVar1 := i_lrCurrentAxisPosition;