Alarms and MLC · SYNTEC

COM Errors — Communication / Compiler / Syntax Errors (SYNTEC)

COM AlarmID in SYNTEC: errors related to program code syntax, variables, mathematical expressions, programming constructs, loops, conditional statements, and program text processing.

This page is also available in RU and PL.

What are COM errors?

The COM (Communication / Compiler / Syntax Errors) section contains errors related to parsing and processing program code. Based on the provided AlarmID list, this group includes syntax errors, invalid variables, errors in mathematical expressions, unterminated strings and unmatched brackets, as well as errors in the structure of loops and conditional constructs.

When a COM error occurs, the primary area to check is the program text and its structure. The AlarmID helps identify which program element or programming construct was processed incorrectly.

Which programming constructs are related to COM?

Based on the provided AlarmID list, COM errors cover several main areas of program checking:

  • Comments and strings
    Errors related to the termination of comments and text strings.
  • Variables and expressions
    Invalid variables, assignment errors, and excessively complex mathematical expressions.
  • Brackets and delimiters
    Missing parentheses or square brackets, semicolons, and other required syntax elements.
  • Loops
    Errors in FOR, REPEAT, and WHILE constructs, including missing keywords and incorrectly terminated blocks.
  • Conditional constructs
    Errors in the structure of IF, ELSE, THEN, and END_IF constructs.
  • CASE constructs
    Errors involving keywords and the structure of alternatives within CASE.
  • Invalid characters
    Detection of characters that cannot be correctly processed within the program text.
  • Preprocessor errors
    A separate AlarmID range of 201–399, identified in the source table as custom preprocessor alarms.
Program Code
        ↓
Program Text Parsing
        ↓
Syntax and Structure Check
        ↓
Variables / Expressions / Operators
        ↓
Loops / IF / CASE
        ↓
COM AlarmID

How to use COM AlarmID for diagnostics

Each COM error has its own AlarmID or belongs to an AlarmID range specified in the source table. The error number helps identify the type of syntax or structural problem detected and determines the appropriate direction for checking the program.

When a COM AlarmID appears, first identify the exact error code, locate the corresponding section of the program text, and check the programming construct associated with that AlarmID.

COM Alarm
      ↓
Identify AlarmID
      ↓
Locate the Corresponding Code Section
      ↓
Determine the Error Type
      ↓
String / Comment
Variable / Expression
Brackets / Delimiters
FOR / REPEAT / WHILE
IF / CASE
Invalid Character
      ↓
Correct the Program Code Structure

Important: a COM AlarmID identifies the type of error detected while processing the program text. Corrections should be based on the specific AlarmID and the corresponding section of the program, without making assumptions about codes that are not present in the source list.

COM Error Table

The table below contains the AlarmIDs included in the provided COM table. The numbering contains gaps: if a particular AlarmID is not present in the source list, it should not be added artificially. The 201–399 range is preserved as a single range in accordance with the source table.

AlarmIDOriginal Description (Chinese)English TranslationDiagnostic Meaning / Notes
001在批注中遇到档案结束的符号End-of-file symbol encountered within a commentComment block is unclosed (e.g., missing a closing parenthesis ) or */). Check comment syntax in the program.
002没有字符串符号结尾的字符串String lacks a terminating quotation mark (unclosed string)A text string or file path is missing its closing quotes. Add quotes at the end of the string.
003句法错误Syntax errorGeneral structural or formatting error in a program statement or command.
004无效的变数Invalid variableA reserved keyword, undefined identifier, or illegal variable name has been used.
005数学式太复杂Mathematical expression is too complexNesting depth or formula length exceeds compiler limits. Simplify the expression by breaking it down.
006EXIT子句在重复循环之外EXIT statement outside of a repetitive loopAn EXIT command to break out of a loop was placed outside of a valid loop body (WHILE, FOR, REPEAT).
007重复循环太深Loop nesting depth is too deepThe maximum allowed level of nested loops within loops has been exceeded.
008子句中没有结束的符号';'Missing terminating semicolon (';') in statementA semicolon is missing at the end of an instruction line.
009错误的给值符号':= 'Invalid assignment operator (':=')Incorrect syntax for variable assignment. Verify the usage of the assignment sign :=.
010没有右边的')'Missing closing right parenthesis ')'Parentheses are unbalanced in an expression. Add the missing ).
011没有右边的']'Missing closing right bracket ']'Brackets are unbalanced (usually in arrays or index definitions). Add the missing ].
012关键词是FOR的子句中,找不到'FOR'Keyword 'FOR' not found in a FOR-statement blockThe syntax structure of the FOR loop is broken or incomplete.
013关键词是FOR的子句中,找不到'DO'Keyword 'DO' not found in a FOR-statement blockThe mandatory keyword DO is missing inside the FOR loop definition.
014关键词是FOR的子句中,找不到'END_FOR'Keyword 'END_FOR' not found in a FOR-statement blockThe FOR loop block was not closed with an END_FOR instruction.
015关键词是REPEAT的子句中,找不到'UNTIL'Keyword 'UNTIL' not found in a REPEAT-statement blockThe conditional exit keyword UNTIL is missing from the post-test loop.
016关键词是REPEAT的子句中,找不到'END_REPEAT'Keyword 'END_REPEAT' not found in a REPEAT-statement blockThe REPEAT loop block was not closed with an END_REPEAT instruction.
017关键词是WHILE的子句中,找不到'DO'Keyword 'DO' not found in a WHILE-statement blockThe mandatory keyword DO is missing inside the WHILE loop structure.
018关键词是WHILE的子句中,找不到'END_WHILE'Keyword 'END_WHILE' not found in a WHILE-statement blockThe WHILE loop block was not closed with an END_WHILE instruction.
019关键词是IF的子句中,找不到'THEN'Keyword 'THEN' not found in an IF-statement blockThe mandatory keyword THEN is missing from the conditional IF branch.
020关键词是IF的子句中,找不到'ELSE'或'END_IF'Keyword 'ELSE' or 'END_IF' not found in an IF-statement blockSyntax error in conditional branching. Verify the IF-ELSE-END_IF hierarchy.
021关键词是IF的子句中,找不到'END_IF'Keyword 'END_IF' not found in an IF-statement blockThe conditional IF block was not closed with an END_IF instruction.
022关键词是CASE的子句中,找不到'OF'Keyword 'OF' not found in a CASE-statement blockThe mandatory keyword OF is missing in the CASE selection statement.
023关键词是CASE的子句中,找不到'ELSE'或'END_CASE'Keyword 'ELSE' or 'END_CASE' not found in a CASE-statement blockTermination error or missing branch closure in the CASE statement.
024关键词是CASE的子句中,找不到'END_CASE'Keyword 'END_CASE' not found in a CASE-statement blockThe CASE selection block was not closed with an END_CASE instruction.
025关键词是CASE的子句中,找不到':'或','Colon (':') or comma (',') not found in a CASE-statement blockFormatting or labelling error for conditions/cases inside the CASE statement.
027无效的字符Invalid characterAn unsupported or illegal character has been detected in the program script.
201~399(前处理器自定义警报)(Preprocessor Custom / User-Defined Alarm)Code range reserved for user debugging, macros, or preprocessor expansions.
← All materials in Alarms and MLC