
- •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...
6.6.8Configuration of CAN modules...
CoDeSys supports a hardware configuration according to CANopen Draft Standard 301. The configuration looks like that described for the hardware dependant configuration.
All EDS (Electronic Data Sheet) respectively DCF (Device Configuration File) files which are stored in the configuration files directory CoDeSys is started, can be integrated, edited and displayed in the configuration. In the EDS file the configuration options of a CAN module are described. If you add a module, which is described in a DCF file, only the IEC addresses can be modified, for the module has already been configured completely in a CAN configurator.
Base parameters of a CAN Master
The Base parameters dialog of a CAN master matches that of the other modules (see chapter 6.6.5, 'Base parameters of an I/O Module').
CAN Parameters of a CAN Master
CAN Parameter Dialog for a CAN-Master
The properties for transmission on the CAN bus can be set directly after the insertion of the module or can be called up with the command ’Extras’ ‘Properties’.
Using the selection option, set the required Baud rate which the transmission should take place at.
One differentiates between synchronous and asynchronous transmission modes (see PDO properties) for PDO’s (Process Data Object). The synchronisation message is sent with a unique number Sync. COB-ID (Communication Object Identifier) in the interval in microseconds which is given by the Communication Cycle Period. The synchronous PDO’s are transmitted directly after the synchronisation message in the time window (Sync. Window Length in microseconds). No synchronisation message will be sent if the fields Comm. Cycle Period and Sync. Window Length contain 0.
activate: Only if this option is activated synchronization messages will be transmitted between master and slaves.
Node-Id: serves to identify the CAN module uniquely and corresponds to the set number on the module itself which is between 1 and 127. The Id must be entered as a decimal number. ( Do not mix up with the 'Node number' !)
The CAN bus will automatically initialised and started when downloading is occurring and when the controller system starts up if the option Automatic start is activated. The CAN bus must be started up in the project if this option is not active.
If the option Support DSP301,V3.01 and DSP306 is activated, then modular CAN Slaves as well as some additional extensions concerning the standards DSP301 V3.01 and DSP306 will be supported.
6-36 |
CoDeSys V2.3 |
6 - The Resources
In this case e.g. the stroke of the Heartbeat will be adjustable (Heartbeat Master [ms]:). Working with Heartbeats is an alternative guarding mechanism: In contrast to the Nodeguarding functionality it can be executed by Master- and Slave-Modules. Usually the master will be configured to send heartbeats to the slaves.
Module parameters of a CAN-Master
The module parameters dialog of a CAN master is the same as that for the other modules (see Chapter 6.6.5): The parameters which have been additionally assigned to the master in the configuration file, are displayed here and as a default the values can be edited.
Base parameters of a CAN module
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').
IEC addresses by which the PDO’s (Process Data Object) in the project can be addressed are entered for output and input addresses, whereby the direction (input or output) is defined from view of the module.
A marker address must be given at the diagnostic address of the CAN module. It works like described for the CAN master.
The CAN parameters of a CAN module, which is not acting as master (global watching of the bus), are different to those of a CAN master.
Section General:
The Node-Id serves to identify the CAN module uniquely and corresponds to the set number on the module itself which is between 1 and 127. The Id must be entered as a decimal number.
If DCF write is activated, a DCF file will be created after inserting an EDS file in the defined directory for the compiled files whose name is made up of the name of the EDS file and the Node Id which is tacked on the end.
If the option Create all SDO's is activated, then for all objects SDO's will be created (not only for those that have been modified).
If the option Reset node is activated, then the slave will be reset before downloading the configuration.
CAN parameters of a CAN Module
Section Node guard: (alternatively to guarding by the Heartbeat mechanism)
If the option Nodeguarding is activated, a message will be sent to the module according to the interval set by Guard Time in milliseconds. If the module does not then send a message with the given Guard COB-ID (Communication Object Identifier), it will receive the status "timeout". As soon as the number of attempts (Life Time Factor) has been reached, the module will receive the status "not OK". The status of the module will be stored at the diagnosis address. No monitoring of the module will occur if the variables Guard Time and Life Time Factor are not defined (0).
Section Heartbeat Settings: (alternatively to Nodeguarding)
If the option Activate Heartbeat Producer is activated, the module will send heartbeats according to the interval defined in Heartbeat Producer Time: given in ms.
If the option Activate Heartbeat Consumer is activated, then the module will listen to heartbeats which are sent by the master. As soon as no more heartbeats are received, the module will switch off the I/Os.
CoDeSys V2.3 |
6-37 |

PLC Configuration...
CAN parameters Dialog for a CAN Module
Section Emergency Telegram:
A module sends an emergency message, with a unique COB-Id., when there is an internal error. These messages, which vary from module to module, are stored in the diagnosis address.
The entries "FileInfo" and "DeviceInfo" of the EDS or DCF file from the corresponding module manufacturer are hidden behind the Info button.
CAN Modules Selection for Modular Slaves
In the left column (Available modules) you find all modules which are available for the slave. Mark the desired modules and by using the buttons Add and Remove create a selection in the right column (Selected Modules). The PDOand SDO selection will be updated automatically.
PDO mapping of a CAN module
The tabs Receive PDO mapping and Send PDO mapping in the configuration dialog for a CAN module allow the "mapping" of the module, which is described in the EDS file, to be changed.
All of the "mapable" objects in the EDS file are located on the left side and can be added in the right side to the PDO's (Process Data Object) (">>" button) or removed again (Remove button). The StandardDataTypes can be inserted to create empty spaces in the PDO.
6-38 |
CoDeSys V2.3 |

6 - The Resources
Configuration of a CAN module, PDO-Mapping
The button Insert Element can be used to create further PDO's and to add appropriate objects to them. The allocation of inputs or outputs to the IEC addresses can be achieved over the inserted PDO's. The settings which have been made in the controller system configuration will become visible when one leaves the dialog. The individual objects can be afforded symbolic names there.
The standard set properties of the PDO's can be edited using Properties.
PDO Properties dialog
Each PDO message requires a unique COB-Id (Communication Object Identifier).
The field appears in grey and cannot be edited if an option is not be supported by the module or if the value cannot be changed.
The Inhibit Time is the minimum time between two messages from this PDO. This is to prevent PDO's which are sent when the value is changed from being sent too often.
The CMS Priority Group cannot be changed and describes the relative importance of the PDOs during the CAN transmission. Values from 0 to 7 are displayed, whereby 0 is the highest.
Transmission Type offers you a selection of possible transmission modes for this module: acyclic - synchronous: the PDO will be transmitted synchronously but not periodically.
cyclic – synchronous: the PDO will be transmitted synchronously, whereby the Number of Sync's gives the number of synchronisation messages, which lie between two transmissions of this PDO.
CoDeSys V2.3 |
6-39 |

PLC Configuration...
synchronous – RTR only: the PDO will be updated after each synchronisation message but not sent. It is only sent when there is an explicit request to do so (Remote Transmission Request)
asynchronous – RTR only: the PDO will only be updated and transmitted when there is an explicit request to do so (Remote Transmission Request)
asynchronous – device profile specific and asynchronous - manufacturer specific: the PDO will only be transmitted when specific events occur.
Number of Syncs: If cyclic transmission has been set, enter here the number of synchronisation messages (see 'Com. Cycle period' in the CAN parameter dialog) which should be sent between two transmissions of the PDO.
Event-Time: If an corresponding transmission type is set, enter here in milliseconds (ms) the interval between two transmissions.
Service Data Objects
Here you find a list of all objects in the EDS or DCF file which are in the area of the Index 0x2000 to 0x9FFF and which are marked as writable.
Dialog for configuration of the Service Data Objects (SDO)
The properties Index, Name, Value, Type and Default are displayed for every object. The value can be changed. Mark the value and press the <Space bar>. After making the change confirm the new value with <Enter> or reject it with the <Escape> key.
The set values are transmitted in the form of SDO's (Service Data Object) to the CAN modules at the initialisation of the CAN bus.
Note: All incompatible data types between CANopen and IEC-61131 will be replaced in CoDeSys by the next larger IEC-61131 data type.
6-40 |
CoDeSys V2.3 |