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

6 - The Resources
With Save history list you can save the query results carried out up until that point in an external text file. The dialogue 'Save file as' will appear, in which you can enter a file name with the extension „.bhl" (Browser History List). The command Print last command opens the standard dialogue to print. The current query plus the output data in the message window can be printed.
6.14Tools
The object 'Tools' will be available in the 'Resources' tab if the functionality is enabled for the currently set target system. It shows all available shortcuts (connections) to executable files of external tools, which can be activated by a double-click in order to call these external programs from within CoDeSys. It is defined by the target file which and how many shortcuts are allowed. Depending on this definition the user can add or delete new shortcuts in the 'Tools' folder.
For example the Tools folder in the Object Organizer might look like this:
In this example four tools-shortcuts are installed. One serves for starting another CoDeSys programming system, one for opening the assembler listing in a text editor and two further shortcuts are available to open PDF-files. Shortcuts marked with a "<R>" cannot be modified in CoDeSys. The shortcuts may contain the connection to an editor, e.g. notepad.exe, or to a certain PDF-file, so that a double-click on the entry would open a notepad window showing the assembler listing respectively would open the Acrobat Reader showing the PDF-file.
Additionally you can define certain files which should be downloaded to the PLC as soon as the shortcut is activated.
6.14.1Properties of available Tool Shortcuts (Object Properties)
By a mouse-click on the plus sign at entry 'Tools' in the Resources tab of the Organizer a list of the available shortcuts will open. If you are just starting to set up a new project, you will just see those which are defined in the target file as fix entries. But if the Tools folder already had been modified you might find another shortcuts, added by a user in CoDeSys.
You can view the global tool properties (valid for all shortcuts listed in 'Tools') as well as the properties of single shortcuts.
1. Tool Properties:
If 'Tools' is marked in the Resources tree, you will find the command 'Object Properties' in the context menu or in the menu 'Project' 'Object', which will open the dialog 'Tool Properties'.
There you get a table listing all tool shortcuts which might be used for the currently set target. The following parameters are shown: The Id (unique identification number) of the tool, the Name of the shortcut which is used to reference the shortcut in the Object Organizer, and the Name of the executable file of the tool. The button Advanced expands the dialog resp. closes the extension of the dialog:
CoDeSys V2.3 |
6-71 |

Tools
Dialog 'Tool Properties'
The expanded dialog shows the global properties of the shortcut as defined in the target file. Further on an edit field is available where a (working) Directory can be defined which should be used for actions of the executable file. The path will be saved without closing the dialog as soon as you press the Apply button.
Properties of the Tool:
FixedCount
Number of shortcuts of the tool, which are inserted unalterably and automatically in the Tools folder. Only if "0" is entered here, the user will be able to create as many shortcuts as desired.
Please regard: For shortcuts which are defined as "fix" ones by the target file, the number of possible usage in the Tools folder is predetermined and the properties cannot be modified by the CoDeSys user (cognizable by a "<R>" in the Object Organizer).
Exe-Name:
DefaultDisplayName:
Parameter Template:
File name or full path of the executable file of the tool. Here you also can enter a registry path pointing to an exe-file: "[registry path].<registry entry in this path pointing to an exe-file>"If there is no entry, the file extension of the file, which is given in "Parameter Template", automatically will cause via Windows the start of the exe file of the according tool.
Examples: "C:\programme\notapad.exe", "345.pdf"
Name which is used to represent the tools in the Object Organizer. Possibly the template $(INSTANCE NUMBER) is used (see below 'Parameter Template').
Templates for determining the file which should be opened by the tool. The following templates can be used, connected by the appropriate special characters:
$(PROJECT_NAME) Name of the currently opened project (File name without extension *.pro").
$(PROJECT_PATH) Path of the directory where the project file is (without indication of the drive).
$(PROJECT_DRIVE) Drive where the currently opened project is. $(COMPILE_DIR) Compile directory of the project (including indication of the drive) $(TOOL_EXE_NAME) Name of the exe-file of the tool.
$(DISPLAY_NAME) Name of the current shortcut, as used in the 'Tools' folder.
$(INSTANCE_NUMBER) Number of the shortcut (Instance number, running number, starting with "1")
$(CODESYS_EXE_DIR) Path of the directory where the Codesys exe-file is (including indication of the drive).
The conversion of a template you will see in the dialog for the Shortcut Properties (see below)
Example: "$(PROJECT_NAME)_$(INSTANCE_NUMBER).cfg"
6-72 |
CoDeSys V2.3 |

|
6 - The Resources |
|
The cfg-file with the name <name of current CoDeSys project>_<shortcut |
|
number>.cfg will be opened in the tool. |
DownloadFile |
Files, file pathes resp. templates for file which will be copied to the PLC during |
Templates: |
download.. If option Editable is activated, the list of these files will be editable in the |
|
properties dialog of the shortcut. If a file name is entered without path, the file will be |
|
searched in the directory where the codesys-exe-file is. |
|
Example: |
|
"a.up;$(PROJECT_NAME).zaw;$(INSTANCE_NUMBER).upp" |
|
the files a.up, <current CoDeSys Projekt>.pro and <shortcut number>.upp will be |
|
copied to the PLC during the next download |
2. Shortcut Properties:
Mark a shortcut entry in the 'Tools' tree in the Object Organizer and select the command 'Object Properties' in the context menu or in the 'Project' 'Object' menu. The dialog 'Shortcut Properties' will open, containing the following items:
Command
Parameter
Files to be downloaded
Calling the tool; paths of the exe-file and of the file which is named in 'Parameter' (predefined by the 'Parameter Template', see above)
e.g.: C:\programs\notepad.exe D:\listings\textfile.txt
Path of the file which should be called by the tool. This is defined in the target file and can be edited here, if the option 'Editable' (see below) has been activated.
Primarily you find here the Filenames which are defined by the target file and which are also described in the Tool Properties (DownloadFileTemplate, see above). If option 'Editable' is activated in the extended dialog (see below) then you can modify the list. For this purpose press button New to open the dialog 'Filename', where you can enter another file resp. a file path. If you enter a file without path, then it will be searched in that directory, where the codesys-exe-file is. Button Delete will remove the currently marked list entry.
Button Standard resets the entries of the dialog to the default values defined by the target file. Button Apply saves the done settings without closing the properties dialog.
Button Advanced expands the dialog so that it will look as follows :
Dialog 'Advanced Properties' of a shortcut
CoDeSys V2.3 |
6-73 |

Shortcut Number:
Tool ID:
Default Number of
Shortcuts:
Editable:
Tools
Running number, starting with 1. New shortcuts of the current tool will each get the next higher number. If a shortcut will be removed later, the numbers of the remaining shortcuts will stay unchanged. The shortcut number can be inserted in other definitions by using the template $(INSTANCE_NUMBER) (e.g. see above, 'Parameter Template').
Unique identification number of the tool; defined in the target file.
Number of shortcuts (instances) for a tool. Corresponds to the "FixedCount" defined in the target file. See above, Tool Properties.
If this option is activated, it will be possible to edit the field 'Parameter' resp. the list of files which should be downloaded.
Button OK applies the done settings and closes the Properties dialog.
6.14.2Managing Tool Shortcuts
Creating new Tool Shortcuts
Select the entry 'Tools' or a shortcut entry in the Resources tree of the Object Organizer and select command 'Add Object' in the context menu or in the 'Project' 'Object' menu to open the dialog 'Create Shortcut', see below.
The table lists all tools for which new shortcuts (connections) can be created. According to the definitions in the target file the following parameters are displayed: ID of the tool, default Name of the shortcut and the Name of the executable file.
In order to create a(nother) shortcut for one of the offered tools, select this tool by a mouse-click in the 'ID' column. Hereupon you can modify the default name of the shortcut in the edit field Name of the shortcut and confirm with OK. This will only work if you enter a name which is not yet used.
Dialog 'Create Shortcut'
OK closes the dialog and the new shortcut will be inserted in the Resources tree, represented by the shortcut name and a shortcut number which is 1 higher than the highest one used for a instance of this tool up to now.
In the area below the name field appropriate hints concerning the user inputs will be displayed.
Deleting Tool Shortcuts
Deleting a shortcut can be done via the command Delete in the context menu (right mouse button) or in the 'Project' 'Object' menu. The command is only available, if there is no fix number of shortcuts defined for the currently marked shortcut. The shortcut numbers of the remaining shortcuts will not change if you delete a shortcut.
6-74 |
CoDeSys V2.3 |