Lexical Error (LEX0004): Invalid token '...'.
In a textual worksheet (ST code or data type worksheet), the lexical analysis detected a code construct which cannot be resolved. For example, due to a invalid character, the Lexer is not able to classify this code part, i.e., it cannot determine the token type (e.g., operator, identifier, ...) for it.
The affected code position is underlined in the worksheet.
Error examples: In the ST code, the characters § and ° are used which are not valid according to the IEC 61131 naming convention for identifiers.
Further Info
For information on the naming conventions for identifiers please refer to the respective topics in the chapter "IEC 61131 Programming ![]() ×‣ Extended Identifiers as IEC 61131-3 Variable Names ×". |
Remedy
- Double-click the error message to jump to the affected editor position.
- Correct the invalid token in the relevant line of code.