Compiler Error Messages
Error Message Format
error C# : error description
(# is the error message number)
Example: error C37 : undeclared identifier : i
When there are compilation errors, refer to the error message number for a description of the error.
Error Description
(C1) syntax error:’identifier’
There are many possibilities that can cause a compilation error.
For example:
macro_command main()
char i, 123xyz // this is an unsupported variable name end macro_command
(C2) ‘identifier’ used without having been initialized
Macro must define the size of an array during declaration.
For example:
macro_command main()
char i
int g[i] // i must be a numeric constant
end macro_command
(C3) redefinition error : ‘identifier’
The names of variables and functions within their respective scopes must be unique.
For example:
macro_command main()
int g[10],g // error
end macro_command
(C4) function name error : ‘identifier’
Reserved keywords and constants cannot be used as function names.
For example:
sub int if() // error
(C5) parentheses have not come in pairs
Statement missing “(“ or “)”.
For example:
macro_command main ) // missing “(“
(C6) illegal expression without matching ‘if’
Missing expression in ‘if’ statement.
(C7) illegal expression (no ‘then’) without matching ‘if’
Missing ‘then’ in ‘if’ statement; that is, they are not paired.
(C8) illegal expression (no ‘end if’)
Missing ‘end if’ in ‘if’ statement.
(C9) illegal ‘end if’ without matching ‘if’
Unfinished ‘if’ statement before ‘end if’.
(C10) illegal ‘else’
See Logical Statements for the standard format of ‘if’ statement. Any statement different from the specified format will result in a compilation error.
(C11)’case’ expression not constant
The value following ‘case’ must be a constant.
For example:
macro_command main()
int a = 0
int b
select case a
case b // content following ‘case’ is not a constant
break
end select
end macro_command
(C12) ‘select’ statement contains no ‘case’
Missing ‘case’ in ‘select’ statement.
For example:
macro_command main()
int a = 0
int b
select a // ‘select’ statement contains no ‘case’.
case 1
break
end select
end macro_command
(C13) illegal expression without matching ‘select case’
The ‘select’ and ‘case’ statements are not paired.
(C14) ‘select’ statement contains no ‘end select’
Missing ‘end select’ in ‘select’ statement.
(C15) illegal ‘case’
See Selective Statements for the standard format of ‘case’ statement. Any statement different from the specified format will result in a compilation error.
(C16) illegal ‘case else’
See Selective Statements for the standard format of ‘case else’ statement. Any statement different from the specified format will result in a compilation error.
(C17) illegal expression (no ‘for’) without matching ‘next’
Error in the ‘for’ statement: missing ‘for’ before ‘next’.
(C19) variable data type error
The data type of the variable in the statement is incorrect.
(C20) must be keyword ‘to’ or ‘down’
Missing keyword ‘to’ or ‘down’.
(C21) illegal expression (no ‘next’)
The format of ‘for’ statement is:
for [variable] = [initial value] to [end value] [step]
next [variable]
Any format other than this format will cause a compilation error.
(C22) ‘wend’ statement contains no ‘while’
Error in the ‘while’ statement: missing ‘while’ before ‘wend’.
(C23) illegal expression without matching ‘wend’
Missing keyword ‘wend’.
The format of ‘while’ statement is:
while [logic expression]
wend
Any format other than this format will cause a compilation error.
(C24) syntax error : ‘break’
Illegal ‘break’ statement. The ‘break’ statement can only be used in ‘for’ or ‘while’ statement.
(C25) syntax error : ‘continue’
Illegal ‘continue’ statement. The ‘continue’ statement can only be used in ‘for’ or ‘while’ statement.
(C28) must be ‘macro_command’
There should be ‘macro_command’.
(C29) must be key word ‘sub’
The format of function declaration is:
sub [data type] function_name(…)
………..
end sub
For example:
sub int pow(int exp)
…….
end sub
Any format different from the above syntax structure will result in a compilation error.
(C30) number of parameters is incorrect
Mismatch of the number of parameters.
(C31) parameter type is incorrect
Mismatch in parameter data types. When calling a function, the data types and the number of parameters should match the function declaration; otherwise, a compilation error will occur.
(C33) function name : undeclared function
The function name is not defined.
(C34) expected constant expression
Illegal array index format.
(C35) invalid array declaration
Illegal array declaration.
(C37) undeclared identifier : i ‘identifier’
Using an undefined variable. Only defined variables and functions can be used; otherwise, a compilation error will occur.
(C38) device encoding method is not supported
The parameters for GetData( … ) and SetData( … ) must include valid device address information. If the address is invalid for the supported address type, this error message will be displayed during compilation.
(C39) array index must be integer, short, char or constant
The format of an array is as follows:
Declaration: function name[constant] (constant is the size of the array) Usage: function name[integer, character or constant]
Any array operation different from the above rules will result in a compilation error.
(C40) execution syntax should not exist before variable declaration or constant definition
There should be no execution statement preceding a variable declaration.
For example:
macro_command main( )
int a, b
for a = 0 To 2
b = 4 + a
int h , k // illegal – definitions must occur before any statements or expressions
// for example, b = 4 + a
next a
end macro_command
(C41) float variables cannot be contained in shift calculation
In shift calculation, operands cannot be floats.
(C42) function must return a value
The function should have a return value.
(C43) function should not return a value
The function should not have a return value.
(C44) float variables cannot be contained in calculation
Float variables cannot be contained in the calculation.
(C45) device address error/tag name does not exist
Device address error or tag name does not exist.
(C46) size of function variables is too large (max. 4k bytes)
One-dimensional array size exceeds 4k.
(C47) macro command entry function is not only one
Macro command entry function should be unique.
The format is as follows:
macro_command function_ name( )
end macro_command
(C49) an extended addressee’s station number must be between 0 and 255
In macro commands, the station number within the extended address can only range from 0 to 255.
For example :
SetData(bits[0] , “PLC 1”, LB , 300#123, 100)
// illegal : 300#123 means the station number is 300, but the maximum is 255
(C50) an invalid device name
In the macro command, the device name is not defined in the device list of system parameters.
(C51) macro command do not control a remote device
A macro can only control a local device.
For example :
SetData(bits[0] , “PLC 1”, LB , 300#123, 100)
The macro cannot be executed because “PLC 1” is connected with a remote HMI.
(C52) GetData/GetDataEx/StringGet/StringGetEx cannot use a broadcast station no.
The above syntax cannot be used with a broadcast station number.
(C53) INPORT() must use a “Free Protocol” device
INPORT() must be used on a “Free Protocol” device.
(C54) OUTPORT() must use a “Free Protocol” device
OUTPORT() must be used on a “Free Protocol” device.
(C55) Recipe Database is not supported on this HMI model
This model does not support Recipe Database.
(C56) the data type of ‘identifier’ must be “unsigned”
The data type must be “unsigned”.
(C57) Recipe bit position is out of range
The “Recipe_bit” setting for the used recipe data is out of range.
(C58) assignment is out of range
The assignment of the variable exceeds the limits defined by the data type.
(C59) declaration of global variables in macro library is not allowed
Declaration of global variables in the macro library is not allowed.
(C60) illegal expression following the keyword “step” in the for-loop
There is an illegal expression following the ‘step’ keyword in the ‘for’ statement.
(C61) nested call to sub function is not allowed
Nested calls to sub functions are not allowed.
(C62) case else must be placed at the end of the select case
The ‘case else’ must be placed at the end in the ‘select case’ statement.
(C63) array index exceeds array size
The array index exceeds the size defined for the array.
(C64) data count exceeds the size of read/write buffer
Read/write command exceeds 4k bytes.
(C65) SQL syntax not accepted
The SQL syntax is not supported.
(C66) recipe tag not found
The recipe tag name does not exist in the Recipe Database.
(C67) counter variable of for-loop doesn’t support unsigned data type
The counter variable in the ‘for’ statement does not support the ‘unsigned’ data type.
For example:
macro_command main()
unsigned int i
for i = 5 down 0 step 1 // Unsigned data type is not supported
next
end macro_command
(C68) Conversion Tag size error
Length error when using conversion label related syntax.
(C69) Macro name : ‘identifier’ not found
The macro name used does not exist.
(C70) Macro undefined : Macro ID = ‘identifier’
The macro ID used does not exist.
(C71) syntax error (or number of characters exceeds 2048)
Syntax error (or exceeds 2048 characters).
(C72) parameter value is out of range : ‘identifier’
The parameter value is out of range.
(C73) ’identifier’ does not support GetData/SetData/GetDataEx/SetDataEx/StringGet/StringGetEx/StringSet/StringSetEx
The identifier is not supported for use in the above syntax.
(C74) station no. variable must be between var0 ~ var15
The station number variable must be between var0 and var15.
(C75) Macro function is not supported on this HMI model
This model does not support the macro function.
(C76) the “unsigned” keyword must be followed by a data type
The keyword ‘unsigned’ must be followed by a data type.
(C77) index register syntax error
The index register syntax is incorrect.
(C78) this tag does not support index register
This tag does not support index register.
(C79) index register is not supported on this HMI model
This model does not support index register.
(C80) function does not support if/while/for/switch statement
The function does not support if/while/for/switch statements.
(C82) string must be declared as a char or unsigned char array
The string must be declared as a char or unsigned char array.
(C83) ’identifier’ must be a constant data
The identifier must be a constant.
(C84) array data exceeds array size
The array data exceeds the array size.
(C85) illegal expression (no ‘select’) without matching ‘end select’
The ‘select’ keyword is missing in ‘end select’.
(C95) total number of characters exceeds 100000
The total number of characters for a macro command should not exceed 100,000.
To utilize a macro command that exceeds the character limit, users need to adjust the command’s character count to be below 100,000 first. Once adjusted, the SYNC_TRIG_MACRO function can be employed to synchronously trigger the execution of other macro commands. This approach enables the successful execution of a macro command with a total character count exceeding 100,000.
