When you generate code and build the target, messages are displayed in the Output window that either confirm the success of the operation or inform you of errors.
Some modeling constructs can cause code generation errors. Checking the model before generating the code enables you to discover and correct most of these errors before they can cause serious problems.