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.
| AlarmID | Original Description (Chinese) | English Translation | Diagnostic Meaning / Notes |
|---|---|---|---|
001 | 在批注中遇到档案结束的符号 | End-of-file symbol encountered within a comment | Comment 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 error | General structural or formatting error in a program statement or command. |
004 | 无效的变数 | Invalid variable | A reserved keyword, undefined identifier, or illegal variable name has been used. |
005 | 数学式太复杂 | Mathematical expression is too complex | Nesting depth or formula length exceeds compiler limits. Simplify the expression by breaking it down. |
006 | EXIT子句在重复循环之外 | EXIT statement outside of a repetitive loop | An 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 deep | The maximum allowed level of nested loops within loops has been exceeded. |
008 | 子句中没有结束的符号';' | Missing terminating semicolon (';') in statement | A 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 block | The syntax structure of the FOR loop is broken or incomplete. |
013 | 关键词是FOR的子句中,找不到'DO' | Keyword 'DO' not found in a FOR-statement block | The mandatory keyword DO is missing inside the FOR loop definition. |
014 | 关键词是FOR的子句中,找不到'END_FOR' | Keyword 'END_FOR' not found in a FOR-statement block | The FOR loop block was not closed with an END_FOR instruction. |
015 | 关键词是REPEAT的子句中,找不到'UNTIL' | Keyword 'UNTIL' not found in a REPEAT-statement block | The conditional exit keyword UNTIL is missing from the post-test loop. |
016 | 关键词是REPEAT的子句中,找不到'END_REPEAT' | Keyword 'END_REPEAT' not found in a REPEAT-statement block | The REPEAT loop block was not closed with an END_REPEAT instruction. |
017 | 关键词是WHILE的子句中,找不到'DO' | Keyword 'DO' not found in a WHILE-statement block | The mandatory keyword DO is missing inside the WHILE loop structure. |
018 | 关键词是WHILE的子句中,找不到'END_WHILE' | Keyword 'END_WHILE' not found in a WHILE-statement block | The WHILE loop block was not closed with an END_WHILE instruction. |
019 | 关键词是IF的子句中,找不到'THEN' | Keyword 'THEN' not found in an IF-statement block | The 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 block | Syntax error in conditional branching. Verify the IF-ELSE-END_IF hierarchy. |
021 | 关键词是IF的子句中,找不到'END_IF' | Keyword 'END_IF' not found in an IF-statement block | The conditional IF block was not closed with an END_IF instruction. |
022 | 关键词是CASE的子句中,找不到'OF' | Keyword 'OF' not found in a CASE-statement block | The 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 block | Termination error or missing branch closure in the CASE statement. |
024 | 关键词是CASE的子句中,找不到'END_CASE' | Keyword 'END_CASE' not found in a CASE-statement block | The CASE selection block was not closed with an END_CASE instruction. |
025 | 关键词是CASE的子句中,找不到':'或',' | Colon (':') or comma (',') not found in a CASE-statement block | Formatting or labelling error for conditions/cases inside the CASE statement. |
027 | 无效的字符 | Invalid character | An 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. |