Use the "info", "text", "warning" and "error" pragmas in objects with ST code (Structured Text) to generate compiler messages manually.
CODESYS Clip: Compiler messages via pragma