
- •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...
Address: This edit field only will be available if it was activated by an entry in the configuration file. Insert the desired address for the channel.
Base parameters dialog for a channel
Channel parameters
Corresponding to the Module parameters dialog the Channel parameter dialog is used to display and modify the parameters of a channel: Index, Name, Value, Default, Min., Max. This dialog also can be replaced by a customer specific dialog 'Custom Parameters'.
Bitchannels
Bitchannels are automatically inserted, when a channel is defined with an entry CreateBitChannels=TRUE in the configuration file.
The Base parameters dialog of bitchannels just contains the field Comment.
6.6.7Configuration of Profibus Modules...
CoDeSys supports a hardware configuration corresponding to the profibus DP standard. In the profibus system you find master and slave modules. Each slave is provided with a parameter set by ist master and supplies data on request of the master.
A PROFIBUS DP system consists of one or several masters and their slaves. First the modules must be configured so that a data exchange over the bus is possible. At the initialization of the bus system each master parameterizes the slaves which are assigned to it by the configuration. In a running bus system the master sends and/or requests data to/from the slaves.
The configuration of the master and slave modules in CoDeSys is based on the gsd files attached to them by the hardware manufacturer. For this purpose all gsd-files which are stored in the configuration files directory will be considered. The modules described by a gsd file can be inserted in the configuration tree and their parameters can be edited there.
Below a master there can be inserted on or several slaves.
If a DP master is selected in the configuration tree, the following dialogs will be available in the right part of the configuration: Base parameters, DP Parameter, Bus parameters, Module parameters.
If a DP slave is selected, which is inserted below a DP master, the following dialogs can be available (depending on the definitions in the configuration file): Base parameters, DP Parameter, Input/Output, User parameters, Groups, Module parameters. Depending on the settings in the configuration file the dialog "DP Parameter" might have another title .
If a DP slave is inserted on the level of a master, the following dialogs are available for configuration: Base parameters, DP parameters, Input/Output, Module parameters.
6-28 |
CoDeSys V2.3 |

6 - The Resources
Base parameters of the DP master
The Base parameters dialog of a DP master matches that of the other modules (see chapter 6.6.5, 'Base parameters of an I/O Module').
Module parameters of the DP master
The Module parameters dialog of a DP master matches that of the other modules: The parameters assigned to the master in addition to the DP and bus parameters in the configuration file are displayed here and the values can be edited in the standard case (see Chapter 6.6.5 'Module parameters of an I/O Module' ).
DP parameters of the DP master
This dialog shows the following parameters extracted from the device file of the DP master (The dialog might have a different title, which is defined in the configuration file):
DP parameters dialog for DP master
Info Manufacturer, GSD Revision, ID (identification number), HW Release and SW Release (hardand software version), GSD-Filename
Module name The settings can be edited at this position.
Addresses Station address: The allowable range extends from 0 to 126. Each device newly inserted on a bus line is automatically provided the next higher address. (note: Address 126 is the default DP slave address). Manual entry is possible; addresses are tested for duplication.
Highest station address: The highest station address (HSA) assigned on the bus is displayed. Here, a lower address can also be entered in order to narrow the GAP range (that is, the address range within which the search for newly-active devices is carried out).
The GSD file pertaining to a device can be opened and examined using the GSD File button.
The Groups button leads to the 'Group properties' dialog. The Group properties pertain to the slaves assigned to the master. Up to eight groups can be set up. For each group, enter whether it is to operate in Freeze mode and/or Sync mode. By assigning slaves (see 'Properties of the DP slave' 'Group assignment') to various groups, data exchange from the master can be synchronized via a global control command. With a Freeze command, a master instructs a slave or a group to „freeze" inputs in their instantaneous state and to transfer these data in the following data exchange. With a Sync command, the slaves are instructed to synchronously switch to output at the next Synch command all data received from the master following the first command.
CoDeSys V2.3 |
6-29 |

PLC Configuration...
To switch the Freeze and Sync options for a group on/off, please click with the left mouse button on the appropriate location in the table to place or remove an „X" next to the desired option, or use the right mouse button to activate or deactivate the option via a context menu. In addition, you can edit the group name here.
DP Parameter of the DP master / Group Properties
Bus parameters of the DP master
The bus parameters describe the timing of the communication. If the option Optimize is activated, then the parameter values will be calculated automatically depending on the Baudrate set by the user and the settings given by the GSD files.
Attention: : The automatically calculated values are just approximated values !
Bus parameters of the DP master
All parameters can also be edited manually.
Baud rate |
The entries already present in the GSD file are available for selection, but only a |
|
transmission rate supported by all slaves can be entered. |
Optimize |
If the option is activated, the entries made in the 'Bus parameters' dialog will be |
|
optimized with respect to the specifications in the GSD files; it is only possible to |
|
edit the values if the option is deactivated. |
|
Important: The values calculated automatically are only rough approximate values. |
6-30 |
CoDeSys V2.3 |

|
6 - The Resources |
Slot Time |
Maximum time during which the master waits, after sending a request message, |
|
for the receipt of the first character of the slave's reply message |
Min.Station Delay |
min. TSDR (in tbit): minimum reaction time after which a station on the bus may |
|
reply (min. 11 tBit) |
Max.Station Delay |
max. TSDR (in tbit): maximum time span within which a slave must reply. |
Quiet Time |
TQUI (in tbit): idle period which must be taken into account during conversion of |
|
NRZ (Non Return to Zero) signals to other codings (switchover time for repeater) |
Target Rotation |
TTR (in tbit): token cycle time setting; projected time interval in which a master |
Time |
should receive the token. Result of the sum of the token stop times of all masters |
|
on the bus. |
Gap Update Factor GAP update factor G: number of bus cycles after which the master's GAP (address range from its own bus address to the address of the next active station) is searched for an additional, newly inserted active station.
Max. Retry Limit maximum number of repeated request attempts by the master when it has not received a valid response from the slave
Min. Slave Interval Time between two bus cycles in which the slave can process a request from the master (time basis 100µs). The value entered here must be checked against the respective specifications in the slave's GSD file.
Poll Timeout Maximum time after which the master's reply by a master-master communication must be retrieved by the requester (Class 2 DP master) (time basis 1 ms).
Data Control Time Time in which the master reports its status to the slaves assigned to it. At the same time, the master monitors whether at least one data exchange each has taken place with the slaves within this period, and updates the Data_Transfer_List.
Watchdog Time Time value for the access monitoring (watchdog). Setting is currently not supported (fixed-set to 400 ms)
Base parameters of a DP slave
The Base parameters dialog of a DP slave matches that of the other modules (see chapter 6.6.5, 'Base parameters of an I/O Module').
Base parameter dialog for a DP slave
CoDeSys V2.3 |
6-31 |

PLC Configuration...
DP parameters of a DP slave
This dialog shows the following parameters extracted from the device file of the DP slave (The dialog might have a different title, which is defined in the configuration file):
DP parameters dialog for a DP slave
Info |
Manufacturer, GSD Revision, HW Release and SW Release (hardand |
|
software version), GSD-Filename, Slave type |
Standard parameter |
Identnumber: Unique identnumber assigned by the PNO for this device type. |
|
Allows unambiguous reference between a DP slave and the corresponding |
|
GSD file. |
|
TSDR (Tbit*): Time Station Delay Responder: Reaction time, the earliest time |
|
after which the slave is permitted to respond to the master. (min. 11 TBit) |
|
* TBit: Time unit for transfer of a bit on the PROFIBUS; Reciprocal value of |
|
the transmission rate; e.g. 1 TBit at 12MBaud=1/12.000.000 Bit/sek=83ns |
|
Lock/Unlock: Slave is locked or released to other masters: |
|
0: min.TSDR and slave-specific parameters may be overwritten |
|
1: Slave released to other masters, |
|
2: Slave locked to other masters, all parameters are accepted; |
|
3: Slave released to other masters |
Identification |
Station address (see 'Properties of the DP masters'), Station name |
|
(matches device name, editable) |
Activation |
Slave is active/inactive in current configuration. If activation is not selected, |
|
configuration data will still be transferred to the coupler on Download, but not |
|
data exchange occurs over the bus. |
Watchdog |
If Watchdog Control is set active, the entered Watchdog time applies |
|
(access monitoring, basis 10 ms). If the slave has not been accessed by the |
|
master within this time, it is reset to its initialization state. |
6-32 |
CoDeSys V2.3 |

6 - The Resources
You can inspect the corresponding GSD file via the GSD-File button.
In-/outputs of a DP slave
Dialog for configuring the in-/outputs of a DP slave
The way in which the configuration of a DP slave is done, depends on whether it is a 'modular' or a 'non-modular', 'fix' slave.
The selection of the module for a modular slave is done like described in the following:
In the list on the left part of the dialog select the desired inputor output-module and press button Select to get it into the window on the right hand. Wrong entries in that window can be corrected via the button Delete. Inserted modules will be immediately displayed in the configuration tree. If they are selected there, the appropriate dialog Profibus Modul will be available, showing the input-, outputand diagnosis address of the module. If you select a channel which has been inserted with the module, the dialog Profibus Channel will open, showing the address of the channel. For each of these both dialogs there might be defined a different title by a setting in the configuration file.
As the maximum data lengths specified in the GSD-file (Max. length of input data, Max. length of output data, Max. length of in-/output data) and the maximum number of modules (Max. number of modules) must be respected, this information is displayed in both module lists. The left block displays the maximum possible values for the device, the right the values resulting from summing the values selected in the configuration. If the maximum values are exceeded, an error message is issued.
The dialog lists in the left window all the inand output modules available in the slave's GSD-file, while the right window contains the configuration currently selected for this device as it relates to inand outputs.
If this is a modular slave (a device that can be equipped with various I/O modules), the selection proceeds as follows: In the left-hand list, the desired inor output module is selected by mouse-click and copied into the right window using the Select >> button. Incorrect entries can be corrected by selecting the undesired module in the right window and pressing the Delete button.
This kind of selection is not possible for non-modular slaves. These directly enforce a closed display of their inand outputs in the right window. Undesired modules can then by removed by selecting and using Delete.
The Properties button leads to the 'Module properties' dialog for the inor output module currently selected in the left or the right list. It shows the Name, the Config (module description coding according to PROFIBUS standard) and the in- and output lengths of the module in bytes. If the module description in the GSD file contains specific parameters in addition to the standard set, these
CoDeSys V2.3 |
6-33 |

PLC Configuration...
are listed here with their values and range of values. If the Symbolic names option is activated, the symbolic names are then used.
Module properties dialog for in-/outputs of a DP slave
User parameters of a DP slave
User parameter dialog for a DP slave
Here, various extended parameters of a DP slave, defined in the GSD-file, are listed. The Parameters column shows the name of the parameter. The parameter values entered in Value column can be altered by double-click or via the right mouse button. In addition, the Value range is specified.
If symbolic names are also specified for the parameters in the GSD-file, the Symbolic names option can be activated, so that the values can be displayed with these names. For information, the Length of user parameters is also given above the table.
6-34 |
CoDeSys V2.3 |

6 - The Resources
Group assignment of a DP slave
Dialog for group assignment of a DP slave
This dialog is used for assigning the slave to one or more of the eight possible groups. The universally applicable group properties (Sync. Mode and/or Freeze Mode), on the other hand, are defined during configuration of the master's properties (see 'Properties of the DP master, Group properties'). This dialog can also be reached via the Global Group Properties button.
The group(s) to which the slave is assigned are marked with a plus sign. The assignment to or removal from a group is accomplished by selecting the group name in the Group Membership column and pressing 'Add slave to group' or 'Remove slave from group' with the right mouse button, or by clicking again with the mouse to the left of the group name.
A slave device can only be assigned to those groups whose properties it supports. The concerned properties of each slave (Sync. Mode / Freeze Mode) are displayed above the table. The modes supported by the device are checked.
Module parameters of a DP slave
The module parameters dialog of a DP slave matches that of the other modules (see Chapter 6.6.5). The parameters assigned to the slave in addition to the DP and user parameters in the configuration file are displayed here, and the values can be edited in the standard case.
Properties of a DP slave in slave operation of the Profibus
If a Profibus runs in slave mode, the slave device is inserted in the master level of the configuration tree. The configuration can be done in the following dialogs (for a description see the chapters above):
•Base parameters
•DP parameters
•Module parameters
•Input/Output
CoDeSys V2.3 |
6-35 |