Skip to main content

Compiler Error C0586

Message:

Missing initialization for generic variable '{0}'

Possible error cause:

Generic function blocks must be instantiated with parameters for all generic variables. A partial specification is not permitted and will result in an error.

Error correction:

Specify a complete parameter passing so that a parameter is listed (as a value or as an expression) for each generic variable.

Example 518. Example of the error
inst : POU2<(const_1 := 12)>;

Message:

Missing initialization for generic variable 'inst'

Correct code:

inst : POU<12, 12>; //implicit assignments
inst2 : POU2<(const_1 := 12), (const_2 := 12)>; //explicit assignments


For more information, see the following: VAR_GENERIC CONSTANT