Tab: System Events
Object: Task Configuration
On the System Events tab, you define which event calls which function and whether or not the configuration is currently activated. You use this tab when a "system event" (instead of a task) should call a project function.
|
Add Event Handler |
Opens the Add Event Handler dialog |
|
Remove Event Handler |
Deletes the selected list assignment |
|
Event Info |
Shows information from the corresponding event library |
|
Open Event Function |
Opens the editor of the new function for the selected assignment You have selected the implementation language of the new function in the Add Event Handler dialog. |
|
List of mappings of functions to call to events with: Name, Description, Function to call, and Active (enable or disable the configuration) |
|
|
Adds a new assignment "Event – Function to call" to the list |
|
|
Event |
The possible selection depends on the target device. CODESYS marks unavailable events with a red symbol in front of the name. A list of all possible system events is located at the end of this section. |
|
Function to call |
Function name (POU, type FUNCTION) You have to specify the name of the new function. CODESYS inserts the function to the device tree after you confirm the dialog. |
|
Scope |
|
|
Implementation language |
Implementation language for the new function |
|
Description |
Short description of the selected event |
Features in Online Mode
The list of assignments from called functions to events also includes the following information: Event status, Number of calls, and the Online Reset button.
|
Event status |
Does not equal |
|
Number of calls |
Displays how often the event has occurred or the associated function has been called |
|
Online Reset |
CODESYS reinitializes the event lists and resets the counter for the events/function calls. Incorrectly initialized events are displayed with a red status line. |
Possible system events
|
Event |
Description |
Task |
Debugging |
|---|---|---|---|
|
|
Call before starting the application |
Communication task |
No |
|
|
Call after starting the application |
Communication task |
No |
|
|
Call before stopping the application |
Communication task |
No |
|
|
Call after stopping the application |
Communication task |
No |
|
|
Call before resetting the application |
Communication task |
No |
|
|
Call after resetting the application |
Communication task |
No |
|
|
Call before online change of the application |
Communication task |
No |
|
|
Call after online change of the application |
Communication task |
No |
|
|
Call before downloading the application |
Communication task |
No |
|
|
Call after downloading the application |
Communication task |
No |
|
|
Call before deleting the application |
Communication task |
No |
|
|
Call after deleting the application |
Communication task |
No |
|
|
Call before exiting the application |
Communication task |
No |
|
|
Call after exiting the application |
Communication task |
No |
|
|
Event is sent after Code Init. Called within the Task Safe Section and only with an online change. (For example, the copy code for online change is executed here) |
Communication task |
No |
|
|
The event is sent if an exception has occurred in the context of an application. |
Exception handling task of the runtime, or the task itself if the runtime does not support exception handling |
Depends on the task |
|
|
Login of a client to this application |
Communication task |
No |
|
|
Logout of a client from this application |
Communication task |
No |
|
|
Call before reading the inputs |
IEC task |
Yes |
|
|
Call after reading the inputs |
IEC task |
Yes |
|
|
Call before writing the outputs |
IEC task |
Yes |
|
|
Call after writing the outputs |
IEC task |
Yes |
|
|
Event is sent in cycles to the debug loop if the IEC task stops at a breakpoint. |
Communication task |
No |
|
|
Event is sent immediately before the runtime is downloaded. |
Runtime main loop |
No |
|
|
Event is sent during download before exiting the communication server. |
Runtime main loop |
No |
|
|
Event is sent during download before exiting ( |
Runtime main loop |
No |