IF_TargetsHandler - SubscribeEventsListener (Method)

Overview

Type:

Method

Available as of:

V1.4.1.0

This chapter provides information on:

Task

Subscribes the implementation to the targets handler.

Description

The method SubscribeEventsListener allows you to subscribe your implementation to the targets handler. This has the effect that every time one of the events contained in the interface IF_TargetsHandlerEventsListener occurs, the targets handler calls the related method by passing a specific set of information.

Using the method SubscribeEventsListener is optional. It has no effect on the basic functions of the targets handler.

For further information, refer to the library interface IF_TargetsHandlerEventsListener that contains a list of methods that are linked to events that occur during operation of the targets handler (for example, a new target is added to the list, a target is removed).

Interface

Input

Data type

Description

i_ifTargetsHandlerEventsListener

IF_TargetsHandlerEventsListener

An interface containing a list of methods related to events occurring during a regular use of a targets handler function block.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

q_sMsg

STRING[80]

Event-triggered message that gives more detailed information on the diagnostic state.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

Ok

Ok

0

Ok

ExecutionAborted

AlreadyConfigured

100

The function block is already configured.

ExecutionAborted

MaxNumberOfEventsListenersExceeded

107

The number of subscribed events listener is greater than the maximum allowed.

InputParameterInvalid

InterfaceInvalid

122

A provided interface is invalid.

AlreadyConfigured

Enumeration name:

AlreadyConfigured

Enumeration value:

100

Description:

The function block is already configured.

Issue

Cause

Solution

The event listener has not been subscribed.

It was not possible to subscribe an event listener because the function block has already been configured.

Ensure that the method SubscribeEventsListener method is called before a successful call of the Configuration method.

InterfaceInvalid

Enumeration name:

InterfaceInvalid

Enumeration value:

122

Description:

A provided interface is invalid.

Issue

Cause

Solution

The event listener has not been subscribed.

i_ifTargetsHandlerEventsListener contains a null interface.

Provide a valid implementation of the interface IF_TargetsHandlerEventsListener.

MaxNumberOfEventsListenersExceeded

Enumeration name:

MaxNumberOfEventsListenersExceeded

Enumeration value:

107

Description:

The number of subscribed events listener is greater than the maximum allowed.

Issue

Cause

Solution

The event listener has not been subscribed.

The targets handler already contains the maximum allowed number of event listeners.

Ensure that a maximum of Gc_uiMaxNumberOfEventsListeners event listeners is subscribed.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

Status Message: The event listener has been subscribed.