When you input code, the precompile in CODESYS already runs some basic checks. Then, wavy underlines appear under buggy code in the editor and an error message is printed to the messages view.
CODESYS automatically generates the application code from the source code that was written in the development system. This is done automatically before downloading the application to the controller. Before the application code is generated, a test is performed for checking the allocations, the data types, and the availability of libraries. Moreover, the memory addresses are allocated when the application code is generated. You can click “Build Generate Code” or press the [F11] key to run this operation explicitly. This is useful for detecting any errors in your source code, even when the PLC is not connected yet.
CODESYS outputs all errors and warnings to the “Build” category of the messages view. Double-clicking the error message opens the respective POU in the editor with the buggy code marked. As an alternative, you can also jump to the buggy code by right-clicking the error message.
Note the ⮫ settings for this in the CODESYS options.