
- •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

Workspace
position of the cursor is displayed. In the fields next to 'Var 0', 'Var 1', ..., 'Var n' the value of the respective variable is shown.
Another way is the command 'Extras' 'Cursor mode'. With this command two vertical lines will appear in the Sampling Trace. First they are laying one on the other. One of the lines can be moved to the right or to the left by the arrow keys. By pressing <Ctrl>+<left> or <Ctrl>+<right> the speed of the movement can be increased by factor 10.
If additionally the <Shift> key is pressed, the second line can be moved, showing the difference to the first one.
'Extras' 'Multi Channel'
With this command you can alternate between single-channel and multi-channel display of the Sampling Trace. In the event of a multi-channel display, there is a check (9) in front of the menu item.
The multi-channel display has been preset. Here the display window is divided into as many as eight display curves. For each curve the maximum and the minimum value are displayed at the edge.
In a single-channel display, all curves are displayed with the same scaling factor and are superimposed. This can be useful when displaying curve abnormalities.
'Trace in ASCII-File'
With this command you can save a Sampling Trace in an ASCII-file. The dialog box for saving a file is opened. The file name receives the extension "*.txt". The values are deposited in the file according to the following scheme:
BODAS Trace D:\BODAS\PROJECTS\TRAFFICSIGNAL.PRO Cycle PLC_PRG.COUNTER PLC_PRG.LIGHT1 0 2 1 1 2 1 2 2 1
.....
If no frequency scan was set in the trace configuration, then the cycle is located in the first column; that means one value per cycle has been recorded at any given time. In the other respects, the entry here is for the point in time in ms at which the values of the variables have been saved since the Sampling Trace has been run.
In the subsequent columns, the corresponding values of the trace variables are saved. At any given time the values are separated from one another by a blank space.
The appertaining variable names are displayed next to one another in the third line, according to the sequence (PLC_PRG.COUNTER, PLC_PRG.LIGHT1).
6.10Workspace
This object in the 'Resources' tab provides an image of the currently set project options (see chapter 4.2, Project Options). If you open it, you get the 'Options' dialog with the know categories.
6.11Parameter Manager ..
The Parameter Manager is a a target specific component of the CoDeSys programming system and must be activated in the target settings. (see chapter 6.11.1).
The Parameter Manager can be used to make variables of a CoDeSys IEC-program, constant parameters or specific system parameters accessible to all CoDeSys compatible systems in a network for the purpose of data exchange, typically via field bus. For this purpose in the editor you can create parameter lists and load down to and up from the runtime system.
6-58 |
CoDeSys V2.3 |

6 - The Resources
Please regard: Parameter lists also can be created resp. filled with entries via pragmas which are included in variable declarations (see chapter 5.2.3).
What are Parameters ?:
In this context parameters are:
•process variables of the CoDeSys IEC project
•process independent parameters
•specific system parameters, predefined by the target system
•function block instances or structure variables, arrays
Each parameter is identified by a certain set of attributes like e.g. 'default value', 'access rights', and especially by an unique access key ('Index', 'SubIndex', 'Name'), which can be addressed for reading or writing data from/to the parameter list. This data exchange can be done via communication services and it is not necessary to know any addresses of variables or to provide any extra functions. So the use of the Parameter Manager functionality it is an alternative to using Network Variables.
What are Parameter Lists?:
Parameter lists are used for organizing the parameters and can be saved with the project and loaded to the local target system which is controlled by the corresponding IEC-program. For each type of parameters there is a corresponding type of parameter list.
Each parameter entry is represented by a line in the parameter list. Each column of the list is representing one of the parameter attributes. In addition to a certain set of standard attributes also manufacturer specific attributes might be used for the description of a parameter in the Parameter Manager.
It depends on the definitions in a target specific description file which attributes (columns) will be visible and editable in the Parameter Manager and in which way they will be arranged in a parameter list. If the description file is missing, the complete standard set of attributes will be displayed, each showing the default value.
Besides lists for project variables and project constants the Parameter Manager also can handle lists for system parameters. Those are parameters which are given by the target system. Further on you can create lists for function block instances or structure variables which base on user-defined templates also created in the Parameter Manager.
Due to the fact that the data are stored independently of the IEC-program, a parameter list for example can be used for saving 'recipes', which are preserved even if the program is replaced by another version. Further on a running PLC can be "fed" with different recipes without the need of a redownload the program.
Parameter Manager Editor in CoDeSys
Note: It is depending on the target system, whether the parameter manager will be regarded at the creation of a boot project.
CoDeSys V2.3 |
6-59 |

Parameter Manager ..
6.11.1Overview, Activating
The Parameter Manager must be activated in the Target Settings, Category Network functionality (see Chapter 6.12).
Also in the target settings dialog the index and subindex ranges for the entries in parameter lists of type parameters and variables, and – if supported by the target – mappings (for CAN Device PDOs) must be defined.
It depends on the target system, whether these options are visible resp. editable for the user.
Activating Parameter Manager in the target settings dialog
6.11.2The Parameter Manager Editor, Overview
In the Resources tab choose the object 'Parameter-Manager'. An editor window will open, where you can create, edit and store parameter lists and in online mode also can load them to the target system and monitor the current parameter values.
Note: In order to have available the Parameter Manager functionality in a CoDeSys project, the option ' Support Parameter Manager' in the Target Settings must be activated and appropriate index ranges must be defined there !
Parameter Manager Editor in CoDeSys
The editor window is bipartite. The left part is used for navigation, it shows a list of all parameter lists currently loaded to the Parameter Manager. The right part contains a table editor, the columns titled with the names of the attributes.
In the navigation window you insert, delete, rearrange or rename parameter lists of different types (Variables, Constant Parameters, Template, Instance, System Parameters).
6-60 |
CoDeSys V2.3 |

6 - The Resources
In the table editor you fill the lists with parameter entries. Each list type will show a special selection of attribute columns which can be edited or just are visible. Either this is defined by a target specific description file or the default settings will be taken.
You can jump between navigation window and table editor by pressing <F6>.
In online mode you can load the lists, you have created before, to the currently connected target system. You also can use the Parameter Manager functions to access them there for the purpose of data exchange with other systems (write values, upload). Further on in the Parameter Manager window you can monitor the current values of the parameters. If currently no online connection is established, the parameter lists just can be created locally and saved with the project.
6.11.3Parameter List Types and Attributes
The Parameter Manager can handle the following parameter list types:
Variables: The entries in parameter lists of this type represent process variables of the project.
Parameters: The entries in parameter lists of this type represent parameters whose values are not attached by the process.
System parameters: The entries in parameter lists of this type represent data which are not attached by the process and which are determined by the target system. System Parameter lists cannot be deleted or renamed.
Template: A template does not contain parameter entries which can be directly accessed for the purpose of data exchange. In fact the entries provide a "basic attribute configuration" for the components of a function block or a structure. Thus a template can be used in parameters lists of type 'Instance'.
Instance: The entries in parameter lists of this type represent parameter entries for variables which are of type of a function block or structure, that means which are instances or structure variables. For an easy entering of the parameters a template is used, which has also been created in the Parameter Manager before.
Mappings: This list type is only available, if it is supported by the target system. The entries represent process variables which are intended to be used in the PDO mapping of a CAN-Device. So mapping lists basically are variables list, but they are working on a separate index/subindex range. This range must be defined in the target settings, category Network functionality! In this case a CANDevice, which is configured in the PLC Configuration, only will use the entries of list type 'Mapping', while otherwise all entries of variables or instances lists will be available in the PDO mapping dialog.
Each list type will be displayed in the Parameter Manager Editor according to the attributes defined by a description file in XML format. If such a file is missing, default settings will be used.
Instances and Templates
An Instance" parameter list ...
... handles parameter entries, which represent a function block, a structure variable or an array. Instance lists for a function block or a structure are each based on a template which is also to be defined in the Parameter Manager for the respective function block resp. structure. Instance lists for arrays cannot use a template made in the Parameter Manager, but directly refer to the array which is used in the project.
A "Template" parameter list ...
... does not contain parameters which are directly accessed for the purpose of data exchange. In fact it defines index and subindex offsets and certain attributes for parameter entries which represent the components of a function block or a structure. The template then can be used in a 'Instance' parameter list (see above), thus providing an easy way to create parameter entries for project variables which are instances of a function block or a structure.
Creating a Template parameter list:
CoDeSys V2.3 |
6-61 |

Parameter Manager ..
In the edit field next to Base POU enter the name of the function block or structure for which a parameter template should be created. Using the input assistant you can browse the available POUs of the project. Press Apply to enter the components of the chosen POU in the parameter list editor. Now edit the attribute fields and close the list to make it available for use in an 'Instance' list.
The command Insert missing entries in the context menu or in the 'Extras' menu will cause an update of the entries according to the current version of the Base POU. This might be necessary after having deleted some lines or after having changed the Base-POU.
If option Synchronous actions is activated, all read-/write accesses on other POUs defined for any list entries, will be executed by the target system synchronously with the call of the respective entry.
For creating Instance parameter lists for arrays it is not necessary to create an template in the Parameter Manager. The template ARRAY will be available implicitly.
Creating an Instance parameter list:
Edit a Template from the selection list below the table. This list offers all templates currently available for function blocks or structures in the Parameter Manager plus the option ARRAY, which you select, if you want to refer directly to an array used in your project. Press Apply to insert the predefined components to the parameter list table.
In the edit field Base variable enter exactly that project variable (must be of type of the function block or the structure or the array which is described by the chosen template), for the components of which you want to create parameter entries.
Enter a Base index and Base subindex for the instance. The indices and subindices of the particular components then will be calculated automatically by adding the index resp. subindex values which are defined in the template for each component (in case of arrays the base will be 0). They will be filled automatically to the respective attribute fields. Example: If you enter a base index "3" for a component, for which an index offset "3000" is defined in the template, the component will be set to index 3003.
For option Synchronous actions please see above: Creating a Template parameter list.
The command Insert missing entries in the context menu or in the 'Extras' menu will cause an update of the entries according to the current version of the used template. That might be useful after having deleted entries or after the template has been modified.
Example:
Create a function block fubo with inputor output variables: a,b,c. In PLC_PRG define the following FBinstances: inst1_fubo:fubo; inst2_fubo:fubo. Compile the project.
Now open the Parameter Manager in order to create parameter lists for the variables inst1_fubo.a, inst1_fubo.b, inst1_fubo.c and inst2_fubo.a, inst2_fubo.b, inst2_fubo. First insert a parameter list which is of type 'Template' and name it "fubo_template". Define the Base-POU: "fubo". Press Apply and define some attributes for the components a,b,c: te. Inter alia enter the Index offsets: for a: 16#1, for b: 16#2, for c: 16#3. Also the SubIndex offsets, e.g. a: 16#2, b: 16#3, c: 16#4.
Now insert a new parameter list which is of type 'Instance'. Choose template "fubo_template". Insert the Base variable "inst1_fubo". Define a Base index of e.g. 16#2300 and a Base subindex of 30 (you must regard the ranges defined in the target settings in tab Networkfunctionality !). Now press Apply to get displayed the indices
6-62 |
CoDeSys V2.3 |