
- •1 A Brief Introduction to CoDeSys
- •1.1 What is CoDeSys
- •1.2 Overview of CoDeSys Functions...
- •1.3 Overview on the user documentation for CoDeSys
- •2 What is What in CoDeSys
- •2.1 Project Components...
- •2.2 Languages...
- •2.2.1 Instruction List (IL)...
- •2.2.2 Structured Text (ST)...
- •2.2.3 Sequential Function Chart (SFC)...
- •2.2.4 Function Block Diagram (FBD)...
- •2.2.5 The Continuous Function Chart Editor (CFC)...
- •2.2.6 Ladder Diagram (LD)...
- •2.3 Debugging, Online Functions...
- •2.4 The Standard...
- •3 We Write a Little Program
- •3.1 Controlling a Traffic Signal Unit...
- •3.2 Visualizing a Traffic Signal Unit...
- •4 The Individual Components
- •4.1 The Main Window...
- •4.3 Managing Projects...
- •4.4 Managing Objects in a Project...
- •4.5 General Editing Functions...
- •4.8 Help when you need it...
- •5 Editors in CoDeSys
- •5.1 This is for all Editors...
- •5.2 Declaration Editor...
- •5.2.1 Working in the Declaration Editor
- •5.2.3 Pragma instructions in the Declaration Editor
- •5.3 The Text Editors...
- •5.3.1 Working in text editors
- •5.3.2 The Instruction List Editor...
- •5.3.3 The Editor for Structured Text...
- •5.4 The Graphic Editors...
- •5.4.1 Working in graphic editors
- •5.4.2 The Function Block Diagram Editor...
- •5.4.3 The Ladder Editor...
- •5.4.4 The Sequential Function Chart Editor...
- •5.4.5 The Continuous Function Chart Editor (CFC)...
- •6 The Resources
- •6.1 Overview of the Resources
- •6.2 Global Variables, Variable Configuration, Document Frame
- •6.2.1 Global Variables...
- •6.2.2 Variable Configuration...
- •6.2.3 Document Frame...
- •6.3 Alarm Configuration
- •6.3.1 Overview
- •6.3.2 General information on alarms, Terms
- •6.3.3 Alarm classes
- •6.3.4 Alarm groups
- •6.3.5 Alarm saving
- •6.3.6 'Extras' Menu: Settings
- •6.4 Library Manager...
- •6.6 PLC Configuration...
- •6.6.1 Overview
- •6.6.2 Working in the PLC Configuration...
- •6.6.3 General Settings in the PLC Configuration
- •6.6.4 Custom specific parameter dialog
- •6.6.5 Configuration of an I/O Module...
- •6.6.6 Configuration of a Channel
- •6.6.7 Configuration of Profibus Modules...
- •6.6.8 Configuration of CAN modules...
- •6.6.9 Configuration of a CanDevice (CANopen Slave)
- •6.6.10 PLC Configuration in Online Mode
- •6.6.11 Hardware scan/State/Diagnosis information from the PLC
- •6.7 Task Configuration...
- •6.7.1 Working in the Task Configuration
- •6.7.2 System Events
- •6.7.3 Taskconfiguration in Online Mode
- •6.8 Watch and Receipt Manager...
- •6.8.1 Overview
- •6.8.2 Watch and Receipt Manager in the Offline Mode
- •6.8.3 Watch and Receipt Manager in the Online Mode
- •6.9 The Sampling Trace
- •6.9.1 Overview and Configuration
- •6.9.2 Display of the Sampling Trace
- •6.9.3 'Extras' 'Save Trace'
- •6.9.4 'Extras' 'External Trace Configurations'
- •6.10 Workspace
- •6.11 Parameter Manager ..
- •6.11.1 Overview, Activating
- •6.11.2 The Parameter Manager Editor, Overview
- •6.11.3 Parameter List Types and Attributes
- •6.11.4 Managing parameter lists
- •6.11.5 Editing parameter lists
- •6.11.6 Parameter Manager in Online Mode
- •6.11.7 Export / Import of parameter lists
- •6.12 Target Settings
- •6.13 The PLC-Browser
- •6.14 Tools
- •6.14.1 Properties of available Tool Shortcuts (Object Properties)
- •6.14.2 Managing Tool Shortcuts
- •6.14.3 Frequently asked questions on Tools
- •7.1 What is ENI
- •7.2 Preconditions for Working with an ENI project data base
- •7.3 Working with the ENI project data base in CoDeSys
- •7.4 Object categories concerning the project data base
- •8 DDE Interface
- •8.1 DDE interface of the CoDeSys programming system...
- •8.2 DDE communcation with the GatewayDDE Server...
- •9 The License Management in CoDeSys
- •9.1 The License Manager
- •9.1.1 Creating a licensed library in CoDeSys
- •10 APPENDIX
- •Appendix A: IEC Operators and additional norm extending functions
- •Arithmetic Operators...
- •Bitstring Operators...
- •Selection Operators
- •Comparison Operators...
- •Address Operators...
- •Calling Operators...
- •Type Conversions...
- •Numeric Operators...
- •Appendix B: Operands in CoDeSys
- •Constants
- •Variables
- •Addresses
- •Functions
- •Appendix C: Data types in CoDeSys
- •Standard data types
- •Defined data types
- •Appendix D: The CoDeSys Libaries
- •The Standard.lib library
- •String functions...
- •Bistable Function Blocks...
- •Trigger...
- •Counter...
- •Timer...
- •The Util.lib library
- •BCD Conversion
- •Bit-/Byte Functions
- •Mathematic Auxiliary Functions
- •Controllers
- •Signal Generators...
- •Function Manipulators...
- •Analog Value Processing...
- •The AnalyzationNew.lib library
- •The CoDeSys System Libraries
- •Appendix E: Operators and Library Modules Overview
- •Appendix F: Command Line-/Command File
- •Command Line Commands
- •Command File (cmdfile) Commands
- •Appendix G: Siemens Import
- •Import from a SEQ Symbol File
- •Import from a S5 Project File
- •Converting S5 to IEC 61131-3
- •Appendix H: Target Settings in Detail
- •Settings in Category Target Platform
- •Appendix I: Use of Keyboard
- •Appendix J: Compiler Errors and Warnings
- •Warnings
- •Errors

PLC Configuration...
The log that is present in the project will not be overwritten by the command. If the log window is closed and later opened again, or a new Online session is started then the version that is loaded will again be replaced by the project log.
Save… This menu item can only be selected if the project log is currently displayed. It allows an excerpt of the project log to be stored in an external file. For that, the following dialog will be displayed, in which the Online sessions to be stored can be selected:
After successful selection, the standard dialog for storing a file opens ('Save Log').
Display Project Log This command can only be selected if an external log is currently displayed. It switches the display back to the project log.
Storing the project log
Regardless of whether or not the log is stored in an external file (see above), the project log is automatically stored in a binary file entitled <projectname>.log. If a different path is not explicitly given in the 'Project' 'Options' 'Log' dialog, the file is stored in the same directory as that in which the project is stored.
The maximum number of Online sessions to be stored can be entered in the 'Project' 'Options' 'Log' dialog. If this number is exceeded during recording, the oldest session is deleted to make room for the newest one.
6.6PLC Configuration...
6.6.1Overview
The PLC Configuration is found as an object in the register card Resources in the Object Organizer. With the PLC Configuration editor, you must describe the hardware the opened project is established for. For the program implementation, the number and position of the inputs and outputs is especially important. With this description, CoDeSys verifies whether the IEC addresses used in the program also actually exist in the hardware.
The base of working in the configuration editor is/are the configuration files (*.cfg; see below Note concerning version compatibility') and the device files (.e.g. *.gsd, *.eds). These are stored in the directory which is defined in the target file (see Target Settings) and are read when the project is opened in CoDeSys. You can add files to this directories at any time.
The configuration file *.cfg describes a basic configuration, which is mapped in the configuration editor, and it defines to which extent the user can customize this configuration in the editor.
Attention: As soon as the underlying configuration file (*.cfg) has been modified, you have to redo the configuration in CoDeSys!
Note concerning version compatibility: In CoDeSys V2.2 a new format was implemented for the PLC Configuration. From that version on the basic configuration files have to use the extension *.cfg. In contrast the configuration editor in former CoDeSys versions needed configuration files with an extension *.con. But: In the target file you can determine that the "old" configurator should be used
6-20 |
CoDeSys V2.3 |

6 - The Resources
furtheron, even when an old project is opened in V2.2 or higher. This avoids the necessarity to create new configuration files, the *.con-files can be used furtheron. If this option is not set in the target file, then you can convert the old PLC Configuration, which is stored in the project, to the new format, if (!) an appropriate new *.cfg-file has been provided. See more details in 'Extras' 'Convert'.
The CoDeSys configuration editor allows configuring I/O modules as well as CAN and Profibus modules.
If supported by the target system, there is the possibility to get information from the PLC: 1. a scan of the actual hardware structure which can directly be used in the PLC Configuration, 2. diagnosis messages which will be displayed as messages in CoDeSys, 3. status information which will be displayed in the PLC Configuration dialog
After the final customization by the user a binary image of the configuration is sent to the PLC:
Example PLC Configuration with a CPU Module and a CAN Module
The PLC Configuration is displayed in the editor in tree structure and can be edited using menu commands and dialogs. The configuration contains input and/or output elements and also management elements which themselves also have sub elements (for example, a CAN-bus or a digital input card with 8 inputs).
For inputs and outputs, symbolic names can be assigned. The IEC-address where this input or output can be accessed is then located behind the symbolic name.
6.6.2Working in the PLC Configuration...
The configuration editor is divided up in two parts. In the left window the configuration tree is displayed. Structure and components of the tree result primarily (Standardconfiguration) from the definitions found in the configuration file, but can be modified by the additional adaptation which is done by the user in the CoDeSys PLC Configurator. In the right window the currently available configuration dialogs are shown on one or several tabs.
The right part of the window is per default visible, but can get faded out via the menu item 'Extras' 'Properties'.
On top of the configuration tree there is the entry of the "root" module with a name, which has been defined in the configuration file.
Below you find hierarchically indented the other elements of the configuration: Modules of different types (CAN, Profibus, I/O), channels or bit channels.
The configuration editor is divided up in two parts. In the left window the configuration tree is displayed. Structure and components of the tree result primarily (Standardconfiguration) from the definitions found in the configuration file, but can be modified by the additional adaptation which is
CoDeSys V2.3 |
6-21 |

PLC Configuration...
done by the user in the CoDeSys PLC Configurator. In the right window the currently available configuration dialogs are shown on one or several tabs.
The right part of the window is per default visible, but can get faded out via the menu item 'Extras' 'Properties'.
On top of the configuration tree there is the entry of the "root" module with a name, which has been defined in the configuration file.
Below you find hierarchically indented the other elements of the configuration: Modules of different types (CAN, Profibus, I/O), channels or bit channels.
Selecting of elements
For selecting elements, click the mouse on the corresponding element, or, using the arrow keys, move the dotted rectangle onto the desired element.
Elements that begin with a plus sign are organization elements and contain sub elements. To open an element, select the element and double-click the plus sign or press <Enter>. You can close opened elements (minus sign in front of the element) the same way.
Insert elements, 'Insert' 'Insert element', 'Insert' 'Append subelement'
Depending on the definitions in the configuration file(s) and on the available device files, which have been read when the project was opened, a basic composition of elements is automatically positioned in the configuration tree. If one of those elements is selected, further elements may be added if this is allowed by the definitions in the configuration file and if the needed device files are available:
•'Insert' 'Insert element': An element can be selected and inserted before the element which is currently marked in the configuration tree.
•'Insert' 'Append subelement': An element can be selected and inserted as subelement of the element which is currently marked in the configuration tree. It will be inserted at the last position.
The most important commands are found in the context menu (right mouse button or <Ctrl>+<F10>).
Please note: If supported by the target system, a scan of the existing hardware can be used for the inserting of modules in the CoDeSys PLC Configuration.
Replacing/switching Elements, 'Extras' 'Replace element''
Depending on the definition in the configuration file, the currently selected element may be get replaced by an other one. The same way it may be possible to switch channels, which are set up in a way that they can be used as input or as output elements. Use the command 'Extras' 'Replace element'
Symbolic names
Symbolic names for modules and channels can be defined in the configuration file. In this case they will be shown in the configuration editor before the 'AT' of the IEC address of the respective element. In the configuration file also is defined whether the symbolic name can be edited or inserted in the configuration editor. To enter a symbolic name, select the desired module or channel in the configuration tree and open a text field by a mouse-click on the 'AT' before the IEC address. In the same manner you can edit an existing symbolic name after a double-clickon the name. Please regard that allocating a symbolic name corresponds with a valid variable declaration !
6.6.3General Settings in the PLC Configuration
Select the entry 'PLC configuration' ('root' module) at top of the configuration tree. Thereupon the dialog 'Settings' is shown in the right part of the window. The following options can be activated:
Calculate addresses: Each newly inserted module automatically is allocated with an address, which results from the address of the module inserted before plus the size of this address. If a module is removed from the configuration, the addresses of the following modules are adjusted automatically. When the command 'Extras' 'Compute addresses' is executed, all addresses starting at the selected node (module) will be recalculated.
6-22 |
CoDeSys V2.3 |

6 - The Resources
Check for overlapping addresses: At compilation the project will be checked for overlapping addresses and a corresponding message will be displayed.
Save configuration files in project: The information which is contained in the configuration file(s) *.cfg and the device description files, which underlie the current PLC Configuration, will be saved in the project.
Thus (if it is not defined by the configuration file, that always the standard configuration should be reloaded !), the configuration as set up by the user will be kept in the project, even if configuration files are not found when the project is re-opened. Keep in mind that in such a case the complete project specific configuration will get lost, if the here described option is not activated !
By saving the configuration information with the project these also will be kept at a target change. But regard in this case, that the new target might bring own configuration files which then will be regarded additionally.
Dialog for the general Settings of the PLC configuration
The global mode of addressing (flat addresses / addresses depending on Id) in the PLC configuration is defined in the configuration file.
Recalculation of Module addresses, 'Extras' 'Compute addresses'
If the option "Calculate addresses" is activated in the dialog 'Settings' of the PLC configuration editor , then the command 'Extras' 'Compute addresses' will start to recalculate the addresses of the modules. All modules starting with the one, which is currently selected in the configuration tree, will be regarded.
Add configuration file
Use this command in the 'Extras' menu to add a further file to the configuration files of the project. These are the files which are found in the directory path(es) specified in the project options, category 'Directories', input field 'Configuration files'.
The dialog Select configuration file will be opened, where you can set a filter for CAN- (*.eds,*. dcf), Profibus- (gsd*.*), configuration- (*.cfg)-files or all files (*.*). After having selected the desired file a check will be done, whether the file is already found in one of the defined directories for configuration files. In this case an appropriate message will appear and the file cannot be added. If a cfg-file is selected, in each case an dialog will open where you get information on what to do.
If the file can be added, the dialog Select configuration directory, where all configuration directories currently defined for the project will appear in a selection list. Choose the directory where the file whereto the file should be copied. After having confirmed this selection by pressing button OK, the dialog will close and the file immediately will be available in the PLC configuration.
Return to standard configuration, 'Extras' 'Standard configuration'
The command 'Extras' 'Standardconfiguration' can be used to restore the original PLC configuration, which is defined by the configuration file *.cfg and saved in the project.
Attention: In the configuration file *.cfg it might be defined that the standard configuration should be restored at each reopening of the project. In this case all adaptations of the configuration done by the user will get lost !
CoDeSys V2.3 |
6-23 |