Table of Contents

AlarmingDecorator

Namespace
ZApplication
Implements

This class implements a decorator for the Alarming interface. Similarily to the [logger decorator]xref:ZAux.IoggerDecorator), this allows to add additional information to an alarm.

This specific decorator implementations automatically sets the source of any alarm that is emitted by this object (i.e. Critical, Fatal, ...) to the name that is set, when this object is constructed.

FUNCTION_BLOCK AlarmingDecorator IMPLEMENTS ZApplication.IAlarming

Constructor

FB_init

The constructor of this object setups of the name that this decorator will set as the alarms source as well as the actual alarming interface that the decorator uses.

METHOD FB_init (
 bInitRetains : BOOL,
 bInCopyCode : BOOL,
 name : ZCore.ZString,
 alarming : IAlarming) : BOOL

Inputs

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)

name ZString

(required) used as the default source when triggering an alarm

alarming IAlarming

(required) external alarming class that is used by this decorator

Returns

BOOL

Properties

AlarmRaised

See AlarmRaised

PROPERTY AlarmRaised : BOOL

Property Value

BOOL

Busy

See Busy

PROPERTY Busy : BOOL

Property Value

BOOL

Done

See Done

PROPERTY Done : BOOL

Property Value

BOOL

Methods

Alarm

See Alarm

METHOD Alarm (
 source : ZCore.ZString,
 text : ZCore.ZString,
 logLevel : ZCore.LogLevel,
 state : AlarmingState,
 incomingAcknowledgementTrigger : ZCore.ITrigger,
 outgoingTrigger : ZCore.ITrigger,
 outgoingAcknowledgementTrigger : ZCore.ITrigger)

Inputs

source ZString

source of the alarm

text ZString

description of the alarm

logLevel LogLevel

severity level of the alarm, messages with higher severity level are prioritized in the alarming system if the maximum number of messages is exceeded

state AlarmingState

initial state of the alarm, bitencoded. The minimum viable state if Incoming

incomingAcknowledgementTrigger ITrigger

(optional) trigger that automatically acknowledges the incoming Incoming state. If set to 0, the alarm has to be acknowledged by an HMI.

outgoingTrigger ITrigger

(optional) trigger that signals that the reason for the alarm has been fixed. If set to 0, the alarm is automatically outgoing

outgoingAcknowledgementTrigger ITrigger

(optional) trigger that automatically acknowledges the outgoing Outgoing state. If set to 0, the alarm has to be acknowledged by an HMI or by a Unit's homing sequence

AlarmRef

See AlarmRef

METHOD AlarmRef (
 source : REFERENCE TO ZCore.ZString,
 text : REFERENCE TO ZCore.ZString,
 logLevel : ZCore.LogLevel,
 state : AlarmingState,
 incomingAcknowledgementTrigger : ZCore.ITrigger,
 outgoingTrigger : ZCore.ITrigger,
 outgoingAcknowledgementTrigger : ZCore.ITrigger)

Inputs

source REFERENCE TO ZString

source of the alarm

text REFERENCE TO ZString

description of the alarm

logLevel LogLevel

severity level of the alarm, messages with higher severity level are prioritized in the alarming system if the maximum number of messages is exceeded

state AlarmingState

initial state of the alarm, bitencoded. The minimum viable state if Incoming

incomingAcknowledgementTrigger ITrigger

(optional) trigger that automatically acknowledges the incoming Incoming state. If set to 0, the alarm has to be acknowledged by an HMI.

outgoingTrigger ITrigger

(optional) trigger that signals that the reason for the alarm has been fixed. If set to 0, the alarm is automatically outgoing

outgoingAcknowledgementTrigger ITrigger

(optional) trigger that automatically acknowledges the outgoing Outgoing state. If set to 0, the alarm has to be acknowledged by an HMI or by a Unit's homing sequence

Clear

See Clear

METHOD Clear ()

Critical

See Critical The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Critical (
 text : ZCore.ZString)

Inputs

text ZString

Debug

See Debug The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Debug (
 text : ZCore.ZString)

Inputs

text ZString

Error

See Error The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Error (
 text : ZCore.ZString)

Inputs

text ZString

ErrorId

See ErrorId

METHOD ErrorId () : UDINT

Returns

UDINT

ErrorMessage

See ErrorMessage

METHOD ErrorMessage () : ZCore.ZString

Returns

ZString

ErrorSource

See ErrorSource

METHOD ErrorSource () : ZCore.IError

Returns

IError

Fatal

See Fatal The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Fatal (
 text : ZCore.ZString)

Inputs

text ZString

Info

See Info The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Info (
 text : ZCore.ZString)

Inputs

text ZString

LogMessageRef

See LogMessageRef

METHOD LogMessageRef (
 timestamp : ULINT,
 text : REFERENCE TO ZCore.ZString,
 logLevel : ZCore.LogLevel)

Inputs

timestamp ULINT

unused, the timestamp can not be set externally for alarm, the datetime instance that has been initialized during construction (FB_init) of this class is used for this.

text REFERENCE TO ZString

description of the alarm

logLevel LogLevel

severity level of the alarm, messages with higher severity level are prioritized in the alarming system if the maximum number of messages is exceeded

SetLevel

See SetLevel

METHOD SetLevel (
 logLevel : ZCore.LogLevel)

Inputs

logLevel LogLevel

SetLevelRef

See SetLevelRef

METHOD SetLevelRef (
 logLevelRef : REFERENCE TO ZCore.LogLevel)

Inputs

logLevelRef REFERENCE TO LogLevel

Trace

See Trace The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Trace (
 text : ZCore.ZString)

Inputs

text ZString

Warning

See Warning The alarm's source is automatically set to the name that is provided when constructing this object.

METHOD Warning (
 text : ZCore.ZString)

Inputs

text ZString