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

Appendix H: - Target Settings in Detail
Appendix H: Target Settings in Detail
10.28 Settings in Category Target Platform
10.28.1 Target system Intel 386 compatible, Category Target Platform
Dialog Target Settings 'Motorola 68K', Target Platform
Dialog item |
Meaning |
Platform |
Type of the target-system |
Support float processor |
if activated: FPU-commands are generated for floating point operations |
Debugging in multitasking |
if activated: additional code is generated, which permits debugging in |
environment |
multitasking environments |
Optimized jumps |
if activated: optimized conditional jumps after compare operations; faster |
|
+ less code (especially on 386/486); Lines containing conditions before |
|
jumps will be displayed in grey color in flow control mode |
Optimized operations with |
Optimized operations with constants (A = A + 1, A < 500 etc.); Faster + |
constants |
less code (especially on 386/486); Constants will be monitored in grey |
|
color in flow control mode |
Optimized Loadoperations |
No load operations will be executed at multiple access on a |
|
variable/constant; Faster + less code |
CoDeSys V2.3 |
10-81 |

Appendix H: - Target Settings in Detail
10.28.2 Target system Motorola 68K, Category Target Platform
Dialog Target Settings 'Motorola 68K', Target Platform
Dialog item
Platform
CPU
Support Float Processor Use 16 bit jump offsets
allow byte-aligned structures
Reserved Register 1
Reserved Register 2
Base register for library data
Output-Mode
Meaning
Target type
Variant of the 68k CPU: basic version 68000 or CPU32 and larger
if activated: FPU-commands are generated for floating point operations
if activated: Jumps for evaluating Boolean expressions work with relative 16 bit Offsets (more complex expressions are possible, but larger code)
if not activated: 8 bit Offsets are used
if activated: only addressing even addresses
if not activated: addressing of odd addresses also possible
A2,A4,A5,A6: The indicated address register is reserved and not used If None: it can be used by the code generator
Additional reserved address register. The indicated address register is reserved and not used If "None" it can be used by the code generator
Register for addressing static data within C libraries (before calling up library functions it is loaded with the address of free memory). If "None" A5 is used as pre-set value.
Nothing = no output
Assembler = During compiling a file "code68k.hex" is created in the compiling directory (Setting under "Project/Options/Directories"). It contains the generated Assembler Code.
Disassembler = In addition to 1 the file contains the Disassembler Code
10-82 |
CoDeSys V2.3 |

Appendix H: - Target Settings in Detail
10.28.3 Target system Infineon C16x, Category Target Platform
Dialog Target Settings 'Infineon C16x', Target Platform
Dialog item |
Meaning |
Platform |
Target type |
Code / Compiler: |
Compiler used during compiling of the target-system and the libraries |
|
(on account of C calling conventions) |
Code / Stack size |
Maximum call depth (nesting) |
Code / Data |
Memory model for data |
Code / Functions |
Memory model for code |
Init. functions |
if activated: Functions contain initialisation code for local variables |
Optimize |
if activated: Code optimizations for constant array indices |
Output HEX-File |
if activated: Output of a Hex-Dump of the code |
Output BIN-File |
if activated: Output of a binary file of the code |
Output MAP |
if activated=Output of a map-file of the code |
Output LST |
if activated=Output of a list-file of the code |
Output LST , of addresses |
if activated=Output of a list of the addresses |
DPPs / |
Data Page Pointers are set |
DPP0..DPP2 |
DPP for DPP0, DPP1, DPP2 |
In Instances |
DPP for short addressing of function block Instances |
Libraries / |
Settings for libraries: |
Code |
Start addresses for code, tables, data, data length, blocks, references |
Tables |
|
Data |
|
Data length |
|
POUs |
|
References |
|
CoDeSys V2.3 |
10-83 |

Appendix H: - Target Settings in Detail
10.28.4 Target systems Intel StrongARM und Power PC, Category Target Platform
The dialog items for these two target systems are identic.
Dialog Target Settings 'PowerPC', Target Platform
Dialog item
Platform
Support float processor
First parameter Register (integer)
Last parameter Register (Integer)
Register for return values (Integer)
First parameter Register (Float):
Last parameter Register (Float):
Register for return value (Float):
Intel byte order
Meaning
Target type
if activated: FPU commands are generated for floating point operations
Register where the first Integer Parameter of C-function calls is transmitted (range dependent on the operating system)
Register where the last Integer Parameter of C-function calls is transmitted (range dependent on the operating system)
Register where the Integer Parameters of C-function calls are returned (range dependent on the operating system)
Register where the first Float Parameter of C-function calls is transmitted (range dependent on the operating system)
Register where the last Float Parameter of C-function calls is transmitted (range dependent on the operating system)
Register where the Float Parameters of C-function calls are returned (range dependent on the operating system)
if activated: Addressing as per Intel address scheme
10-84 |
CoDeSys V2.3 |

Appendix H: - Target Settings in Detail
10.28.5 Target system MIPS, Category Target Platform
Dialog Target Settings 'MIPS', Target Platform
Dialog item
Platform
First parameter Register (integer)
Last parameter Register (Integer)
Register for return values (Integer)
Max. space on the stack for arguments (Byte):
Meaning
Target type
Register where the first Integer Parameter of C-function calls is transmitted (range dependent on the operating system)
Register where the last Integer Parameter of C-function calls is transmitted (range dependent on the operating system)
Register where the Integer Parameters of C-function calls are returned (range dependent on the operating system)
Dependent on Operating System: Maximum size (number of bytes) of arguments, which can be handed over on the stack
CoDeSys V2.3 |
10-85 |

Appendix H: - Target Settings in Detail
10.28.6 Target system 'Hitachi SH', Category Target Platform
Dialog Target Settings 'Hitachi SH', Zielplattform
Dialog item
Platform
First parameter Register (integer)
Last parameter Register (Integer)
Register for return values (Integer)
Max. space on the stack for arguments (Byte):
Support float processor
First parameter Register (Float):
Last parameter Register (Float):
Register for return value (Float):
Intel byte order
Meaning
Target type
Register where the first Integer Parameter of C-function calls is transmitted (range depends on the operating system)
Register where the last Integer Parameter of C-function calls is transmitted (range depends on the operating system)
Register where the Integer Parameters of C-function calls are returned (range depends on the operating system)
Dependent on Operating System: Maximum size (number of bytes) of arguments, which can be handed over on the stack
FPU commands are generated for floating point operations
Register where the first Float Parameter of C-function calls is transmitted (range depends on the operating system)
Register where the last Float Parameter of C-function calls is transmitted (range depends on the operating system)
Register where the Float Parameters of C-function calls are returned (range depends on the operating system)
Intel Byte Adress mode is used
10-86 |
CoDeSys V2.3 |

Appendix H: - Target Settings in Detail
10.28.7 Target system '8051 compatible', Category Target Platform
Dialog Target Settings '8051 compatible', Zielplattform
Dialog item |
Meaning |
Platform |
Target type |
Maximum Stack-Size:(in Bytes) |
Maximum stack size (number of Bytes) |
10.28.8 Target system Infineon C16x, Category Target Platform
Dialog Target Settings 'Infineon C16x', Target Platform
Dialog item |
Meaning |
Platform |
Target type |
CoDeSys V2.3 |
10-87 |

Appendix H: - Target Settings in Detail
Code / Compiler: |
Compiler used during compiling of the target-system and the libraries |
|
(on account of C calling conventions) |
Code / Stack size |
Maximum call depth (nesting) |
Code / Data |
Memory model for data |
Code / Functions |
Memory model for code |
Init. functions |
if activated: Functions contain initialisation code for local variables |
Optimize |
if activated: Code optimizations for constant array indices |
Output HEX-File |
if activated: Output of a Hex-Dump of the code |
Output BIN-File |
if activated: Output of a binary file of the code |
Output MAP |
if activated=Output of a map-file of the code |
Output LST |
if activated=Output of a list-file of the code |
Output LST , of addresses |
if activated=Output of a list of the addresses |
DPPs / |
Data Page Pointers are set |
DPP0..DPP2 |
DPP for DPP0, DPP1, DPP2 |
In Instances |
DPP for short addressing of function block Instances |
Libraries / |
Settings for libraries: |
Code |
Start addresses for code, tables, data, data length, blocks, references |
Tables |
|
Data |
|
Data length |
|
POUs |
|
References |
|
10-88 |
CoDeSys V2.3 |

Appendix H: - Target Settings in Detail
10.29 Target Settings for Category Memory Layout
The items described for this tab can be available for each standard target.
Dialog Target Settings 'Intel 386 compatible', Memory Layout
Dialog item |
Meaning |
Base (Code) |
Automatic activated: Code segment is automatically allocated |
|
Automatic inactivated: Code segment lies on the given absolute |
|
address |
Base (Global) |
Automatic activated: Data segment (global data) are automatically |
|
allocated to the area in question |
|
Automatic inactivated: Data segment (global data) lies on the given |
|
absolute address |
Base (Memory) |
Automatic activated: Flags are automatically allocated to the area in |
|
question |
|
Automatic inactivated: Flag segment lies on the given absolute |
|
address |
Base (Input) |
Automatic activated: Input process image is automatically allocated to |
|
the area in question |
|
Automatic inactivated: Input process image lies on the given absolute |
|
address |
Base (Output) |
Automatic activated: Output process image is automatically allocated |
|
to the area in question |
|
Automatic inactivated: Output process image lies on the given absolute |
|
address |
Base (Retain) |
Automatic activated: Retentive data are automatically allocated to the |
|
area in question |
|
Automatic inactivated: Output process image lies on the given absolute |
|
address |
CoDeSys V2.3 |
10-89 |

Appendix H: - Target Settings in Detail
Area (Code) |
Segment number of the Data segment (Code); |
Area (Global) |
Segment number of the Data segment (global data); |
Area (Memory) |
Segment number of the Flag segment; |
Area (Input) |
Segment number of the Input Process Image |
Area (Output) |
Segment number of the Output Process Image |
Area (Retain) |
Segment number of the retentive data |
Size (Code) |
Size of the Code segment |
Size pro Segment (Global) |
Size of the Data segment |
Size (Memory) |
Size of the flag segment |
Size (Input) |
Size of the Input process image |
Size (Output) |
Size of the Output process image |
Size (Retain) |
Size of the Segment for retentive data |
Total size of data memory |
Total memory data size |
Own retain segment |
if activated: Retentive data are allocated to in separate segment |
Total size of data memory |
Total size of data memory |
Maximum number of global Maximum number of global data segments |
|
data segments |
|
Maximum number of POUs |
Maximum number of POUs allowed in a project |
10.30 Target Settings in Category General
The items described for this tab can be available for each standard target.
Dialog Target Settings, General
10-90 |
CoDeSys V2.3 |
Appendix H: - Target Settings in Detail
Dialog item |
Meaning |
Configurable |
if activated: Support configurable I/O configurations and load |
|
configuration description into the controller |
Support CANopen |
if activated: Support CANopen configuration and load configuration |
configuration |
description into the controller |
Support Profibus |
if activated: Support Profibus configuration and load configuration |
configuration |
description into the controller |
Support preemptive |
if activated: Support Task configuration and load task description into |
multitasking |
the controller |
Download as file |
if activated: I/O description is downloaded in file format |
No address checking |
if activated: At compile the IEC addresses are not checked |
Online Change |
if activated: Online Change functionality |
Singletask in multitasking |
not yet implemented |
Byte-addressing mode |
if activated: byte addressing mode (e.g. var1 AT %QD4 is written in |
|
address %QB4) |
Initialize zero |
if activated: General initialisation with zero |
Download Symbol File |
if activated: If a symbol file has been created it will be downloaded |
Symbol config from INI file |
if activated: The parameters for the symbol configuration are not read |
|
from the project options dialog, but from the codesys.ini file, resp. from |
|
another file which is referenced in the codesys.ini |
PLC-Browser |
if activated: PLC Browser functionality activated |
Trace |
if activated: Trace functionality activated |
VAR_IN_OUT by reference |
if activated: At a function call the VAR_IN_OUT variables are called by |
|
reference (pointer); therefore no constants can be assigned and no |
|
read/write access is possible from outside the function block. |
Initialize Inputs |
if not activated: For optimizing reasons no init code will be generated for |
|
the inputs declared with "AT %IX" (-> undefined values until the 1. bus |
|
cycle !) |
Automatic boot project load |
if activated: A boot project is created automatically after download of a |
|
new program and sent to the PLC. |
Softmotion |
if activated: The SoftMotion functionality is activated, i.e. available in the |
|
Resources tab (CNC program list, CAMs) |
Retain forcing |
if activated: The force list will be kept in the runtime system even at a |
|
logout. In this case at logging out the user will get a dialog where he can |
|
decide whether the forcing really should be retained. (currently |
|
supported by runtime systems CoDeSys SP 32bit full, V2.4, Patch 4 and |
|
CoDeSys SP 32bit). |
Save |
if activated: The runtime system keeps forcing even at a restart. This |
|
option is only available if allowed by the target and if option 'Retain |
|
forcing' (see above) is activated. |
Cycle independent forcing |
if activated: Forcing will not only be done at the begin and end of a |
|
cycle, but all write accesses during the processing of the program will |
|
be deactivated |
CoDeSys V2.3 |
10-91 |

Appendix H: - Target Settings in Detail
10.31 Target Settings in Category Networkfunctionality
The items described for this tab can be available for each standard target.
Dialog Target Settings, Networkfunctionality
Dialog item |
Meaning |
Support parameter manager |
If activated: the entry 'Parameter-Manager' appears in the Resources |
|
tab. Use it to create an Object Dictionary for variables and parameters, |
|
which enable the targeted, active data exchange with other controllers |
Support network variables |
If this option is selected network variables can be used, which enable |
|
automatic data exchange in the network |
Names of supported |
List of the supported network systems, e.g.: CAN; UDP; DP |
networkinterfaces |
|
Index ranges for parameters |
Index Range for Parameter Lists of type 'Parameters' (see Resources, |
|
'Parameter Manager') |
Index-ranges for variables |
Index Range for Parameter Lists of type 'Variables' (see Resources, |
|
'Parameter Manager') |
Index-ranges for Mappings |
Index Range for Parameter Lists of type 'Mappings' (see Resources, |
|
'Parameter Manager') |
Subindex range |
Subindex Range within the above mentioned index ranges for |
|
parameter and variable Object Dictionaries (see Resources, 'Parameter |
|
Manager') |
10-92 |
CoDeSys V2.3 |

Appendix H: - Target Settings in Detail
10.32 Target Settings in Category Visualization
The items described for this tab can be available for each standard target.
Dialog Target Settings, Visualization
Dialog item
Display width in pixel Display height in pixel
Use 8.3 file format
Meaning
An area of the given width and height will be displayed in the editor window when editing a visualization. Thus e.g. the size of the screen on which the target visualization will run later, can be regarded when positioning the visualization elements.
The file names of the bitmaps and language files which are used in the CoDeSys visualization will be shortened to the 8.3-notation format and loaded to the PLC in this format.
Alarmhandling in the PLC The task ALARM_TASK will be inserted automatically in the task configuration. It will process an implicitely created ST-code evaluating the status of the particular alarms and if applicable executing the associated actions. The ST-code needs auxiliary functions of library SysLibAlarmTrend.lib. This library will be loaded automatically. (Additionally the implicitely needed libraries SysLibSockets.lib, SysLibMem.lib,SysLibTime.lib, SysLibFile.lib are loaded. These libraries must be supported by the target system !)
If the option is deactivated and Webor/and Target visualization is activated, at login a warning will be dumped.
Hint: The 'Alarm handling in the PLC' can be used even if no Targetor Web-Visualization has been activated. Even then the required ST-code will be generated.
CoDeSys V2.3 |
10-93 |

Appendix H: - Target Settings in Detail
Store trend data in the PLC The trend handling in the PLC will be activated. The task TREND_TASK will be inserted automatically in the task configuration It will process an implicitly created ST-code for recording the trend data in a ring buffer and - if option History is activated in the trend element - for storing the values in a file system.
|
|
The ST-code needs auxiliary functions of library SysLibAlarmTrend.lib. |
|
|
This library will be loaded automatically. (Additionally the implicitely |
|
|
needed libraries SysLibSockets.lib, SysLibMem.lib,SysLibTime.lib, |
|
|
SysLibFile.lib are loaded. These libraries must be supported by the |
|
|
target system !) |
|
|
If the option is deactivated and Webor/and Target visualization is |
|
|
activated, at login a warning will be dumped. |
|
|
Hint: 'Store Trend data....' can be used even if no Targetor Web- |
|
|
Visualization has been activated. The required ST-code will be |
|
|
generated. |
Activate |
system |
variable The system variable CurrentVisu can be used for switching between |
'CurrentVisu |
visualizations. |
|
Supported |
fonts |
in the List of fonts which are supported by the target system. |
target |
|
|
Web visualization |
if activated: All visualization objects of the project are compiled for the |
|
|
|
usage as Web visualization objects. |
Target visualization |
if activated: All visualization objects of the project are compiled for the |
|
|
|
usage as Target visualization objects. |
Use VISU_INPUT_TASK can only be activated if Target-Visualization is activated, see above)
If activated and 'Deactivate task generation' (see below) is deactivated, then automatically two tasks will be created for controlling the Target Visualization:
•VISU_INPUT_TASK controls the processing of the user inputs by means of the implicitly available POU MAINTARGETVISU_INPUT _CODE
•VISU_TASK controls the repainting of the visualization elements by means of the implicitly available POU MAINTARGETVISU_PAINT _CODE.
If the option is deactivated, only VISU_TASK will be created and only POU MAINTARGETVISU_PAINT_CODE is used, which in this case will additionally include the functionality of MAINTARGETVISU_INPUT_ CODE.
Deactivate task generation (can only be activated if Target-Visualization is activated, see above)
If the option is activated, the tasks VISU_INPUT_TASK und VISU_TASK (see above at 'Use VISU_INPUT_TASK') will not be generated automatically. Thus the above mentioned POUs, resp. - if option Use VISU_INPUT_TASK' is not activated - only POU MAINTARGETVISU_PAINT_CODE can be called in the application program and, if desired, can be controlled by any task, as defined by the programmer. Referring this see the description on the Target visualization (in the user manual for the CoDeSys Visualization).
10-94 |
CoDeSys V2.3 |