Semantic Error: Invalid initial value '...'.
In a 'Variables' table or a Data List, a wrong value for initializing a variable was specified- which does not match the data type of the current variable.
- which is outside the valid value range of the data type.
Rules for initializing variables
- The initial value has to fit to the data type of the variable to be initialized.
- The initial value is optional. If no initial value is used, the variable is initialized with the default initial value of the data type or with the retained value in case of retentive variables.
- Initial values can be defined in conjunction with all declaration keywords except VAR_EXTERNAL.
- It is not possible to initialize variables which are assigned to physical inputs.
Further Info
For information on the value ranges of elementary data types refer to the topic "Elementary Data Types according to IEC 61131-3 ![]() ×‣ Elementary Safety-Related Data Types ×". |