
- •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...
Converting of old PLC configurations, 'Extras' 'Convert'
This command is available in the menu 'Extras' if you open a project containing a PLC configuration, which was created with an older CoDeSys version than V2.2. If all needed configuration files are available, the command 'Convert' will transfer the existing configuration into the format of the actual PLC configuration. A dialog will open which asks "Convert the configuration to the new format ? Attention: Undo is not possible !" You can select Yes or No. If you close the dialog with Yes, the configuration editor will be closed also. Reopen it and you will see the configuration in the new format. Be aware that after having converted the old format cannot get restored anymore !
6.6.4Custom specific parameter dialog
The parametrizing possibilities of the configurator can be expanded by the use of an applicationspecific DLL which is an individual dialog. This 'Hook'-DLL must be in that directory which contains the configuration file and then can be linked by an entry in the configuration file.to a module or channel. If done so, for the concerned modules the standard dialog 'Module parameters' will be replaced by a dialog defined in the DLL.
Example of an application-specific parameter dialog (Custom Parameters)
6-24 |
CoDeSys V2.3 |

6 - The Resources
6.6.5Configuration of an I/O Module...
Base parameters of an I/O Module
Base parameters Dialog for an I/O Module
If an I/O module is selected in the configuration tree, the dialog 'Base parameters' is displayed with the following entries:
Module id: The Module id is a unique identifier of the module within the entire configuration. It is defined by the configuration file and it is not editable in the configuration editor.
Node number: The Node number is defined by an entry in the configuration file or – if there is no entry – by the position of the module in the configuration structure.
Input address, Output address, Diagnostic address: Addresses for Inputand Output respectively for the storage of diagnosis data.
These addresses refer to the module. It depends on the general settings, which addresses are already predefined, which address mode is valid and whether the addresses can be still edited here.
Load module description: If this option is deactivated, the module will not be regarded at a download of the project. Per default the option is activated and it is defined in the configuration file *.cfg whether it is visible and editable in the configuration dialog.
Do not adapt address automatically: This option is only available if defined by the configuration file. If it is activated, the module will not be regarded in case of a recalculation of the addresses. (Default: Option is deactivated.)
The diagnosis in the PLC configuration:
A marker address must be given at the diagnostic address of the module. For normal I/O modules it depends on the special hardware configuration how the diagnosis will be handled. For bus systems like CAN or Profibus DP the diagnosis works like described in the following: From the given diagnosis address onwards there will be stored various information concerning the structure GetBusState which is part of a corresponding library delivered by the manufacturer (e.g. BusDiag.lib by 3S - Smart Software Solutions). All bus modules get a request to fill the diagnosis structure in a cyclic sequence each time when an IEC task has written or read process data to/from the modules. As soon as at least one module in the bus system produces an error, the specific diagnosis information can be read using the function block DiagGetState which is also part of the above mentioned library. This function is only available for bus masters, which have been configured within the CoDeSys PLC configuration!
See in the following the input and output parameters of the function block DiagGetState. Define an instance of this function block in your CoDeSys project to read the diagnosis information for a specific bus module:
CoDeSys V2.3 |
6-25 |

PLC Configuration...
Input variables of DiagGetState:
ENABLE: BOOL; |
At a rising edge of ENABLE the function block starts working |
|
|
|
|
DRIVERNAME:POINTER TO |
Name of the driver (address of the name) to which the diagnosis |
|
STRING; |
request should be sent. If here is entered a 0, the diagnosis request |
|
|
will be forwarded to all present drivers. |
|
|
|
|
DEVICENUMBER:INT; |
Identification of the bus which is managed by the driver. E.g.: the |
|
|
Hilscher driver can handle up to 5 cards (busses). The index is 0- |
|
|
based. |
|
|
|
|
BUSMEMBERID:DWORD ; |
Unique bus-/driver specific identification of the busmodule (E.g.: for a |
|
|
CANopen-card this is the NodeID, for a PB-DP card this is the |
|
|
station address of the participant etc. ) |
|
|
|
|
Output variables of DiagGetState |
||
|
|
|
READY:BOOL ; |
TRUE: the work on the diagnosis request has been terminated |
|
|
|
|
STATE:INT; |
If READY = TRUE then STATE gets one of the following values |
|
|
which define the actual state of the function block: |
|
|
-1: invalid input parameter |
|
|
(NDSTATE_INVALID_INPUTPARAM:INT;) |
|
|
0: function block does not work (NDSTATE_NOTENABLED:INT;) |
|
|
1: function block is just reading the diagnosis info |
|
|
(NDSTATE_GETDIAG_INFO:INT;) |
|
|
2: diagnosis info is now available |
|
|
(NDSTATE_DIAGINFO_AVAILABLE:INT;) |
|
|
3: no diagnosis info is available |
|
|
(NDSTATE_DIAGINFO_NOTAVAILABLE:INT;) |
|
|
|
|
EXTENDEDINFO: |
Up to 100 Bytes manufacturer specific diagnosis data of the bus. For |
|
ARRAY[0..129] OF BYTE; |
each bus participant 1 byte is reserved in which the 0 – 2 are used |
|
|
as described in the following: |
|
|
Bit 0: Bus module exists in PLC configuration. |
|
|
Bit 1: Bus module is available in bus system. |
|
|
Bit 2: Bus module reports error. |
|
|
|
6-26 |
CoDeSys V2.3 |

6 - The Resources
Module parameters / Custom parameters of an I/O Module
Module parameters Dialog
In this dialog the parameters which are given by the device file are shown. Only the column 'value' is editable.
Index: The Index is a consecutive digit (i), which numbers through all the way the parameters of the module.
Name: Name of the parameter
Value : Value of the parameter, editable
Initially the default is displayed. Values can be set directly or by means of symbolic names. If the entries in the configuration file are not set to 'Read Only', they can be edited. To do that click on the edit field respectively select on of the entries in a scroll list. If the value is a file name, you can open the dialog 'Open file' by a double-click and browse for another file there.
Default: Default value of the parameters
Min.: minimum value of the parameter (only if no symbolic names are used) Max.: maximum value of the parameter (only if no symbolic names are used) A tooltip may give additional information on the currently marked parameter.
Instead of the Module parameters dialog there might be a customer specific dialog. This is due to the fact, that such a dialog is linked by an entry (Hook-DLL) at the module definition in the configuration file.
6.6.6Configuration of a Channel
Base parameters of a channel
Channel-Id: Globally unique identifier of the channel
Class: Defines whether the channel is used as input (I), output (Q), or as input and output (I&Q), or whether it is switchable (I|Q). If the channel is switchable, this can be done by the command 'Extras' 'Replace element'.
Size: Size of the channel [Byte]
Default identifier: Symbolic name of the channel
The name of the channel is defined in the configuration file. Only if it is allowed by the definition of the father module, the name of the channel can be edited in the configuration tree.
Comment: Additional information on the channel
In the edit field a comment can be inserted or modified.
CoDeSys V2.3 |
6-27 |