Skip to main content

Compiler Error C0198

Message: String constant '<string value>' too long for destination type '<data type>'

Possible error cause: The string constant has too many characters.

Error correction: Use shorter string constants or declare larger strings.

Example 426. Example of the error:
PROGRAM PLC_PRG
VAR
    str : STRING(4) := '12345';
END_VAR

Message:

C0198: String constant '12345' too long for destination type 'STRING(4)'