Options for Build

If you choose this category in the Options dialog box , then you get the following dialog box:

../_images/1c9149b143758f860a33139006eab46b1
  • Debugging:  It depends on the target descriptions whether this option can be activated/deactivated by the user resp. which is the given setting . If it is activated, additional debugging code is created, that is the code can become considerably larger. The debugging code is needed in order to make use of the debugging functions offered by CoDeSys (e.g. breakpoints). When you switch off this option, project processing becomes faster and the size of the code decreases. The option is stored with the project.

  • Replace constants:  The value of each constant of scalar type (thus not for strings, arrays and structures) is loaded directly, and in Online mode the constants are displayed in green. Forcing, writing and monitoring of a constant is then no longer possible. If the option is deactivated, the value is loaded into a storage location via variable access (this does in fact allow writing the variable value, but implies longer processing time).

  • Nested comments:  Comments can be placed within other comments.

    Example:

    (*

    a:=inst.out; (* to be checked *)

    b:=b+1;

    *)

    Here the comment that begins with the first bracket is not closed by the bracket following “checked,” but only by the last bracket.

    Attention: Currently this option must be used carefully: If the setting in the project does not match the setting chosen in a library which also has been created in CoDeSys and now is used is the project, compiler errors will occur, which are hard to interpret by the user and often cannot be cleared!

  • Create binary file of the application: A binary image of the generated code (boot project) is created in the project directory during compilation. File name: <project_name>.bin. By comparison, the command sets up the boot project on the controller.

  • Actions hide programs: This option is activated per default, when a new project is created. It means: If a local action has the same name like a global variable or a program, the following hierarchy is valid: local variable before local action before global variable before program.

    Regard: If an existing project is opened, which has been created with a previous CoDesys version, the option will be deactivated per default. Thus the previously vlid hierarchy (local varaible before global variable before program before local action) can be kept.

  • Treat LREAL as REAL: If this option is activated, (availability depends on the runtime system, default: not activated), the compile will handle LREAL values as REAL values. This can be used for creating platform independent projects.

  • Number of data segments: Here you define how many memory segments should be allocated in the PLC for the project data. This space is needed to make possible even if new variables have been added. If during compilation you get the message “Out of global data memory…”, enter a higher number. In this regard local program variables will be handled like global variables.

  • Exclude objects: This button opens the dialog Exclude objects from build: In the tree of project components select those POUs which should not be regarded during compilation and activate option Exclude. Hereupon the excluded POUs will be displayed green-colored in the selection tree. Press button  Exclude unused, if you just want to get displayed those POUs which are currently used in the program. Regard that a single object which is selected in the Object Organizer can also be excluded from build by using the command ‘Exclude from build’ from the context menu.

  • Compiler Version: Here you define the compiler version to be used. CoDeSys versions after V2.3.3 (version, service pack, patch) will include besides the actual compiler version also the previous compiler versions (back to V2.3.3). If you want to get the project compiled with the latest compiler version in any case, activate option Use latest. In this case however it will be checked whether the currently opened programming system is also of that version. If this is not true, the compiler version matching the actually used programming system version will be used!. If the project should be compiled with a specific version, define this via the selection list at  Fix.

    In order to exert control over the compilation process you can set up two macros:

    The macro in the Macro before compile field is executed before the compilation process; the macro in the Macro after compile field afterwards. The following macro commands can not, however, be used here: file new, file open, file close, file save as, file quit, online, project compile, project check, project build, project clean, project rebuild, debug, watchlist.

  • Check automatically: In order to get the semantic correctness checked at each compilation of the project the following options can be activated:

    • Unused variables
    • Overlapping memory areas
    • Concurrent access
    • Multiple write access on output

    The results will be displayed in the message window. These checks also can be initiated by the respective commands of the ‘Check’ submenu in the ‘Project’ menu. If supported by the target system, negative check results will produce compiler errors.

Note

All entries in the Build Options dialog are stored with the project.