Skip to main content

TcError

Short summary​

This class is a concrete CNM alarm implementation that uses the TwinCAT event logger classes. Alarms can be thrown and need to be cleared explicitly by calling TcError.Clear() .

AccessAbstractFinalExtendsImplements
NoYesAbstractMessageCNM_MessageInterfaces.IAlarm

UML Diagram​

Parameters

none

Properties​

arguments​

Type: Tc3_EventLogger.I_TcArguments

This property returns an interface pointer that defines methods for the argument handling.…

automaticallyClearArguments​

Type: BOOL

This property can be used to control the clear behaviour of the event. If the flag is set to true,…

className​

Type: CNM_AbstractObject.ClassName

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

id​

Type: DINT

This property returns the ID of the event.…

isPending​

Type: BOOL

This property contains the information of wether the message was already thown and is active (TRUE),…

messageServiceProvider​

Type: CNM_MessageInterfaces.IMessageServiceProvider

This property returns the messageServiceProvider of the concrete class.…

source​

Type: Tc2_System.T_MaxString

This property returns the source of the event. The SourceInfo is generated internally as standard behavior.…

state​

Type: CNM_MessageInterfaces.MessageConfirmationState

This property contains the state of the alarm.…

stopCategory​

Type: CNM_MessageInterfaces.AlarmStopCategory

This property contains the stop catagory of the alarm.…

Methods​

clear​

  • Return type: VOID

This method clears the message and resets it to a predefined state.…

FB_Exit​

  • Parameters:
    • bInCopyCode (BOOL): TRUE: the exit method is called in order to leave the instance which will be copied afterwards (online change).
  • Return type: BOOL

FB_Exit must be implemented explicitly. If there is an implementation, then the…

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)
    • event (Global.TcEventEntry)
    • injectedService (CNM_MessageInterfaces.IMessageService)
  • Return type: BOOL

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

throw​

  • Return type: VOID

This method throws/sends the message and sends it to the associated message service to be handled.…

Code​

Declaration​

FUNCTION_BLOCK FINAL TcError EXTENDS AbstractMessage IMPLEMENTS CNM_MessageInterfaces.IAlarm
VAR
myMessageServiceProvider :MessageServiceProvider(0);
myAlarm : Tc3_EventLogger.FB_TcAlarm;
clearArguments :BOOL := TRUE;
END_VAR