Use the System Events tab of the Task Configuration editor to call a project function by a system event (not by a task). You can define the functions that are called per event, and you can activate or deactivate each system event individually.
This function is not available for all supported controllers. Consult the Programming Guide specific to your controller for further information.
Button |
Description |
---|---|
Add Event Handler... |
Opens the Add Event Handler dialog box that allows you to define an assignment between an event and the function it calls. |
Remove Event Handler |
Deletes the selected list assignment. |
Event Info |
Displays information of the corresponding event library. |
Open Event Function |
Opens the editor of the new function for the selected assignment. The implementation language of the new function is selected in the Add Event Handler dialog box. |
Element |
Description |
---|---|
Event |
Displays a list of system events for selection. The available events depend on the target controller. Unavailable events are marked with a red symbol. |
Function to call |
Enter a name for the function. A new POU, type Function is created with this name and added to the Applications tree when you confirm the Add Event Handler dialog box with OK. |
Scope |
oSelect the option Application to make the new function available for the application. oSelect the option POUs to make the new function available for the entire project. |
Implementation language |
Select the programming language for the new function. |
Description |
Provides a short description of the selected event. |
The system events you define with the Add Event Handler dialog box are displayed in the list of the System Events tab:
Column |
Description |
---|---|
Name |
Indicates the name of the Event you defined in the Add Event Handler dialog box. |
Description |
Indicates a short description of the selected event. |
Function to call |
Indicates the name of the function you defined with the parameter Function to call in the Add Event Handler dialog box. |
Active |
The option is by default selected and the function is activated. To deactivate the function, deselect the option Active. |
The list of the System Events tab displays additional information in online mode. Consult the Programming Guide specific to your controller for controller-specific information on the supported system events.
Column |
Description |
---|---|
Event Status |
0 indicates that no error has been detected. If the value is not 0, then an error has been detected. |
Number of Calls |
Indicates the number of times the event has occurred and the associated function has been called. |
Button |
Description |
---|---|
Online Reset |
Click the Online Reset button to reinitialize the event lists, and to reset the counter for the events / function calls. Events that are not correctly initialized are displayed with a red Event Status cell. |
The table lists the system events that can be displayed:
Event |
Description |
Task |
Debugging |
---|---|---|---|
AfterWritingOutputs |
Called after writing outputs. |
IEC task |
Yes |
BeforeReadingInputs |
Called before reading inputs. |
IEC task |
Yes |
CodeInitDone |
The event is sent after new application code is initialized during online-change. |
Communication task |
No |
Exception |
The event is sent if an exception has been detected in the context of an application. |
During an IEC exception, the event is called from the system exception task or the task with the exception itself. |
Depends on the task. |
Login |
Login of a client in this application. |
Communication task |
No |
Logout |
Logout of a client from this application. |
Communication task |
No |
OnlineChangeDone |
Called after application online change. |
Communication task |
No |
PrepareOnlineChange |
Called before application online change. |
Communication task |
No |
sercos_BeforeChangeToPhase0 |
Called before change to phase 0. |
TskSercos3App |
No |
sercos_BeforeConnectSlaves |
Called before real slaves are mapped to logical slaves in the Devices tree. |
TskSercos3App |
No |
sercos_TasksPhase0 |
Called during change to phase 0. |
TskSercos3App |
No |
sercos_TasksPhase1 |
Called during change to phase 1. |
TskSercos3App |
No |
sercos_TasksPhase2PostFW |
Called after change to phase 2 |
TskSercos3App |
No |
sercos_TasksPhase2PreFW |
Called before change to phase 2 |
TskSercos3App |
No |
sercos_TasksPhase3PostFW |
Called after change to phase 3 |
TskSercos3App |
No |
sercos_TasksPhase3PreFW |
Called before change to phase 3 |
TskSercos3App |
No |
sercos_TasksPhase4 |
Called during change to phase 4. |
TskSercos3App |
No |