
- •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
6.3Alarm Configuration
6.3.1Overview
The alarm system integrated in CoDeSys allows detecting critical process states, recording them and visualizing them for the user with the aid of a visualization element. he alarm handling can be done in CoDeSys or alternatively in the PLC. For alarm handling in the PLC please see the target settings category 'Visualization'.
For the configuration of the alarm system the entry 'Alarm configuration' is available in the 'Resources' tab.
Here you define Alarm classes and Alarm groups. An alarm class serves for the typing of an alarm, that means it assigns certain parameters to the alarm. An alarm group serves for the concrete configuration of one or several alarms (which get assigned a certain class and further parameters) for the use in the project. Thus a class is useful for structuring the available alarms. The different alarm groups are defined by the user by inserting appropriate entries below the header 'System' in the configuration tree.
For the visualization of alarms the element 'Alarm table is available in the CoDeSys visualization. Using this table the user can watch and acknowledge alarms.
If a History, i.e. recording of Alarm-Events should be written to a log-file, such a file must be defined and for each alarm group the saving behaviour must be defined.
When you open the 'Alarm configuration' in the Resources tab, the dialog 'Alarm configuration' opens with a bi-partite window, which concerning the mode of operation is similar to that of the PLC Configuration or Task configuration. In the left part the configuration tree is displayed, in the right part the appropriate configuration dialog will be opened.
Example of an Alarm configuration
Open by a mouse-click on the plus sign at the entry 'Alarm configuration' the currently available configuration tree. If you are going to create a new configuration, this tree only will show the entries 'Alarm classes' and 'System'.
CoDeSys V2.3 |
6-9 |

Alarm Configuration
6.3.2General information on alarms, Terms
The usage of an alarm system in CoDeSys obeys the following universal descriptions and definitions concerning alarms:
•Alarm: Generally an alarm is regarded as a special condition (expression value).
•Priority: The priority, also named "severity", of an alarm describes how important (severe) the alarm condition is. The highest priority is "0", the lowest valid priority value is "255".
•Alarm state: An expression/variable configured for the alarm control can have the following states: NORM (no alarm), INTO (alarm just has come), ACK (alarm has come and has been acknowledged by the user), OUTOF (alarm state has been terminated, alarm "has gone", but not yet acknowledged!)
•Sub-State: An alarm condition can have limits (Lo, Hi) and "extreme" limits (LoLo, HiHi). Example: The value of an expression ascends and first will transit the HI-limit, thus causing the coming of an HI-alarm. If the value continues ascending and exceeds also the HIHI-limit before the alarm gets acknowledged by the user, then the HI-alarm will get acknowledged automatically and just the HIHI-alarm remains in the alarm list (which is an internal list used for alarm administration). The HIstate in this case is named sub-state.
•Acknowledgement of alarms: The main purpose of alarms is to inform the user on alarm situations. In doing so it often is necessary to make sure that the user has noticed this information (see possible actions assigned to an alarm in the alarm class configuration). The user must acknowledge the alarm in order to get the alarm removed from the alarm list.
•Alarm Event: An alarm event must not be mixed up with an alarm condition. While an alarm condition can be valid for a longer period of time, an alarm event just describes the momentary occurrence of an change, e.g. a change from the normal state to the alarm state. In the CoDeSys alarm configuration for the three types of events and the corresponding alarm states the same names are used (INTO, ACK, OUTOF).
In CoDeSys the following features are supported:
•Deactivation of the alarm generation for single alarms as well as for alarm groups
•Selection of the alarms which should be displayed by defining alarm groups and priorities
•Saving of all alarm events in an alarm table
•Visualization element 'Alarm table' in the CoDeSys Visualization
6.3.3Alarm classes
Alarm classes are used for the general description of certain alarm criteria, such as how to handle acknowledgements (confirmation of an alarm by the user), which actions should automatically run as soon as a particular alarm state has been detected and which colors and bitmaps are to be used for a visualization of an Alarm table. Alarm classes are defined globally in the Alarm configuration and are then available as a base configuration when configuring alarm groups.
Configuration of alarm classes:
Select entry 'Alarm classes' in the alarm configuration tree. The configuration dialog 'Alarm classes' gets opened:
6-10 |
CoDeSys V2.3 |

6 - The Resources
Configuration dialog 'Alarm classes'
Press button Add in order to create a new alarm class. Thereupon in the upper window a line will be inserted, primarily only with an entry "NOACK" (no acknowledgement) in the 'Acknowledgement' column. Define a name for the alarm class in the corresponding field in the Name column (open an edit frame by a mouse-click on the field) and if necessary modify the acknowledgement type in column
Acknowledgement.
The following acknowledgements are available:
NO_ACK: No acknowledgement of the alarm by the user is required
ACK_INTO: A "come" alarm condition (status "INTO", alarm occurs) must be confirmed by the user.
ACK_OUTOF: A "gone alarm" (status "OUTOF", alarm terminated) must be confirmed by the user.
ACK_ALL: Gone and come alarm conditions must be confirmed by the user. Additionally you can enter a Comment.
Entries for further alarm classes each will be added at the end of the list. Use button Delete to remove the currently selected entry from the list.
Assigned actions for class <class name>:
Each alarm class defined in the upper window can get assigned a list of actions, which should be performed as soon as a Alarm Event occurs.
In the list of Possible actions select one and press button ">" to get it into the field Assigned actions. This field will finally contain the selection of actions assigned to the alarm class. Via button ">>" you can add all actions at a single blow. Via "<" resp.. "<<" you can remove one or all actions from the done existing selection. If an action is marked in the 'Assigned actions' list, via "..." a
CoDeSys V2.3 |
6-11 |

Alarm Configuration
corresponding dialog can be opened to define the desired e-mail settings, the printer settings, the process variable resp. the executable program and, if applicable, a message text.
The following action types (Possible actions) are supported (for a definition of a message text see below):
Action |
Description |
|
|
|
Settings to be done in the corresponding dialog: |
||
|
|
|
|||||
Save: |
The alarm event will be |
The settings are done in the Alarm group |
|||||
|
saved internally, in order to |
definition in the Alarm saving dialog |
|
||||
|
be given out |
e.g.in |
a |
log- |
|
|
|
|
file. Please regard: In this |
|
|
||||
|
case the log-file must be |
|
|
||||
|
defined |
in the |
configuration |
|
|
||
|
of the alarm group ! |
|
|
|
|
||
|
|
|
|||||
Print: |
A message text is sent to a |
Printer: Select one of the printers defined on |
|||||
|
printer. |
|
|
|
|
the local system; Outputtext: Message text |
|
|
|
|
|
|
|
(see below) which should be printed out |
|
|
|
|
|
|
|||
Message: |
In the |
current |
visualization |
Message: Message text to be displayed in the |
|||
|
of the alarm a message |
message window |
|
||||
|
window |
will |
be |
opened |
|
|
|
|
showing the defined text. |
|
|
||||
|
|
|
|||||
E-Mail: |
An e-mail containing the |
From: e-mail address of sender; To: e-mail |
|||||
|
defined |
message |
will |
be |
address of recipient; Subject: any subject; |
||
|
sent. |
|
|
|
|
Message: Message text (see below); Server: |
|
|
|
|
|
|
|
Name of the e-mail server |
|
|
|
|
|||||
Variable: |
A variable of the CoDeSys |
Variable: Variable name: You can select |
|||||
|
program will get the alarm |
project variables via the input assistant (<F2>): |
|||||
|
status resp. a message text |
A boolean variable will indicate the alarm states |
|||||
|
string. |
|
|
|
|
NORM =0 and INTO=1, an integer variable will |
|
|
|
|
|
|
|
indicate the alarm states NORM =0, INTO =1, |
|
|
|
|
|
|
|
ACK =2, OUTOF =4; a string variable will get |
|
|
|
|
|
|
|
the message text defined in field; |
Message |
|
|
|
|
|
|
(see below) |
|
|
|
|
|||||
Execute: |
An executable file will be |
Executable file: name of the file to be |
|||||
|
started as soon as the alarm |
executed (e.g. notepad.exe, you can use the |
|||||
|
event occurs. |
|
|
|
"..." button to get the standard dialog for |
||
|
|
|
|
|
|
selecting a file; Parameter: |
appropriate |
|
|
|
|
|
|
parameter(s) which should be attached to the |
|
|
|
|
|
|
|
call of the exe-file |
|
|
|
|
|
|
|
|
|
Definition of the message text:
For action types 'Message', 'Print', 'Email' or 'Variable' you can define a message text which should be output in case of an Alarm Event.
Line breaks at the |
text definitions in 'Message', 'Email' or 'Variable' can be inserted by |
|
<Ctrl>+<Enter>. |
|
|
The following placeholders can be used when defining the alarm message: |
||
|
|
|
MESSAGE |
|
The message text which is defined for the particular alarm in the |
|
|
configuration of the alarm group will be used. |
|
|
|
DATE |
|
Date, when the alarm status was reached (INTO). |
|
|
|
TIME |
|
Time of alarm entry. |
|
|
|
EXPRESSION |
|
Expression (defined in alarm group) which has caused the alarm. |
|
|
|
6-12 |
CoDeSys V2.3 |

|
|
|
6 - The Resources |
|
|
PRIORITY |
|
Priority of the alarm (defined for alarm group.) |
|
|
|
|
||
|
|
|
|
|
|
VALUE |
|
Current value of the expression (see above). |
|
|
|
|
|
|
|
TYPE |
|
Alarm type (defined in alarm group) |
|
|
|
|
|
|
|
CLASS |
|
Alarm class (defined in alarm group) |
|
|
|
|
|
|
|
TARGETVALUE |
|
Target value for alarm types DEV+ and DEV- (defined in alarm |
|
|
|
|
group) |
|
|
|
|
|
|
|
DEADBAND |
|
Tolerance of the alarm (defined in alarm group) |
|
|
|
|
|
|
|
ALLDEFAULT |
|
Any information on the alarm will be output, like described for the line |
|
|
|
|
entries in a log file (History). |
|
|
|
|
|
|
Example of defining an alarm message:
For a definition of a message box enter the following in the message window:
Further on when defining the alarm in the alarm group enter in column 'Message' the following: "Temperature critical !". The output of the final alarm message will be like follows:
Note: The message text will also be affected in case of a change of the project language if it is included in a *.vis-file or a translation file *.tlt. BUT: In this case - like texts referring to a visualization it has to be set between two "#"-characters (e.g. in the example shown above : "#Temperature critical !#" and "TIME /EXPRESSION: MESSAGE #current#: VALUE", in order to get the text entered in the translation file as ALARMTEXT_ITEMs.)
A log file for action 'Save' is to be defined in the configuration of the alarm group (see Chapter 6.3.4).
Alarm Events for actions:
For each action you define, at which alarm events it should be started.
Activate the desired events:
INTO |
The alarm occurs. Status = INTO. |
ACK |
Acknowledgement by the user has been done. Status = ACK. |
OUTOF Alarm state terminated. Status = OUTOF.
CoDeSys V2.3 |
6-13 |