Skip to main content

OperationHandlerMessageService

Short Summary

This class forwards a raised alarm/message to the global message service and informs the node about the error. It also stops the assigned operation mode handler in case of a critical error. The global message service can be injected with the poperty setter of 'globalMessageSerice'.

AccessAbstractFinalExtendsImplements
NoYesCNM_AbstractObject.ObjectCNM_OpModeHandlingInterfaces.IOpModeHandlerMessageService

UML Diagram

Parameters

none

Properties

className

Type: CNM_AbstractObject.ClassName

This abstract property returns the class name of the concrete object,

globalMessageService

Type: CNM_MessageInterfaces.IMessageService

This interface extends the IMessageInterface with the possibility to inject a global message service where the errors will be forwarded to.

Methods

clear

This method clears the given message from the service.

FB_Init

  • Parameters:
    • bInitRetains (BOOL): if TRUE, the retain variables are initialized (warm start / cold start)
    • bInCopyCode (BOOL): if TRUE, the instance afterwards gets moved into the copy code (online change)
    • handler (CNM_OpModeHandlingInterfaces.IOpModeHandler): the handler where this message service belongs to
  • Return type: BOOL

The constructor FB_init is needed to create an unique hash code.

handle

This method handles the given message.

stopOpModeHandler

This method stops the runnning operation mode. Depending on the stop category of the event it can enable the stop request flag

Code

Declaration

FUNCTION_BLOCK FINAL OperationHandlerMessageService EXTENDS CNM_AbstractObject.Object IMPLEMENTS CNM_OpModeHandlingInterfaces.IOpModeHandlerMessageService
VAR
forwardingMessageService :CNM_MessageInterfaces.IMessageService;
myHandler :CNM_OpModeHandlingInterfaces.IOpModeHandler;
END_VAR