-

InOut Variables: Rules and Specific Characteristics

InOut variables are formal parameters of function block POUs. They can be declared using the 'Usage' keyword 'InOut' in the variables table of an FB POU. An InOut formal parameter is both, input and output of the FB. Within the POU, the variable can be read or written. When reading/writing an InOut variable, a reference (pointer) to the memory address of the formal parameter is processed.
Typically, InOuts are used for complex data types such as strings, arrays and structures.

The following rules apply for InOut variables and when calling an FB with an InOut formal parameter: