Programs and function blocks can call a program. A program call is not allowed in a function. There are not instances of programs.
If a ⮫ POU, ⮫ POU, ⮫ POU calls a program and values of the program change as a result, then these changes are retained until the next program call. The values of the program are retained even if the next call is made by another POU. This is different from calling a function block. When the function block is called, only the values of the respective instance of the function block change. The changes are to be considered only when a POU calls the same instance again.
You can also set the input and/or output parameters for a program directly when you call it.
Syntax: <program>(<input variable> := <value>, <output value> => <value>):
If you use the Input Assistant to insert a program call and the “Insert with arguments” option is selected in the Input Assistant, then CODESYS adds input and/or output parameters to the program call according to the syntax.
Examples
Calls:
AWL:

With assignment of the parameters:

ST:
PLC_PRG() erg := PLC_PRG.out2;
With assignment of the parameters:
PLC_PRG(in1:=2, out1=>erg);
