• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - Automation
  • AlarmOperator
  • 5.0.0

AlarmOperator Class

(Automation::AlarmOperator)

The AlarmOperator triggers an alarm based on the input value. An AlarmOperator has no effect on the value. It sets output equal to input. More...

Header: #include <AlarmOperator>
Inherits: CDPOperator<T> and
  • List of all members, including inherited members

Public Functions

AlarmOperator(const CDPPropertyBase &in)
virtual ~AlarmOperator()
std::string GetExtendedData() const override
void SetExtendedData(const std::string &extendedData) override

Reimplemented Public Functions

virtual void Configure(XMLPrimitive *pObjectElement) override
virtual void Create(const char *shortName, CDPBaseObject *pParent) override
virtual void CreateModel() override
virtual void Destroy() override
virtual const CDPPropertyBase &GetOutput() override
virtual unsigned int Process() override
virtual unsigned int Status() const override
  • 18 public functions inherited from CDPOperator
  • 17 public functions inherited from CDPOperatorBase
  • 49 public functions inherited from CDPBaseObject
  • 27 public functions inherited from CDP::StudioAPI::CDPNode
  • 22 public functions inherited from CDP::StudioAPI::ICDPNode

Reimplemented Protected Functions

virtual std::string GetProperty(std::string propertyName) override
virtual int ReceiveMessage(void *message) override
  • 1 protected function inherited from CDP::StudioAPI::CDPNode

Additional Inherited Members

  • 1 public variable inherited from CDPOperatorBase
  • 1 static public member inherited from CDPBaseObject
  • 1 protected function inherited from CDP::StudioAPI::CDPNode
  • 8 protected variables inherited from CDPOperator
  • 5 protected variables inherited from CDPOperatorBase
  • 10 protected variables inherited from CDPBaseObject

Detailed Description

The AlarmOperator triggers an alarm based on the input value. An AlarmOperator has no effect on the value. It sets output equal to input.

The AlarmOperator implements an alarm based on best practices from EEMUA Publication 191, and is an alternative to using CDPAlarm.

The AlarmOperator Argument In is used to control whether the alarm should activate or not. In is checked against Limit. The LimitType property specifies whether the alarm should trigger when In is Below the Limit or when it is above or equal to Limit. In addition, the arguments and properties explained in the tables below can be used to control the functionality of the alarm, such as blocking, deadband etc.

Arguments

NameDescription
InThe input value that the alarm acts on
OutThe input value is passed through unmodified to this value
AckAcknowledges the alarm. When toggled from 0 to 1, the alarm is acknowledged. RepeatCount is reset to 0, STATUS_SET and STATUS_REPEATBLOCKED flags are cleared and an ALARMACK event is triggered.
OperatorBlockedWhen toggled from 0 to 1, Status is updated and the alarm is cleared and acked. Further setting of the alarm is blocked. This argument can for instance be used to implement 'shelving' of alarms, or it can be controlled by the end-user to silence or deactivate an alarm.
ProcessBlockedWhen toggled from 0 to 1, Status is updated and the alarm is cleared. Further setting of the alarm is blocked. This argument is intended to be controlled by the application.
RepeatCountLimitThe limit of the number of times the alarm can be repeated before it is automatically blocked. If RepeatCount is greater or equal to RepeatCountLimit, RepeatBlocked is set; otherwise RepeatBlocked is cleared. Setting RepeatCountLimit equal to 0 disables repeat counting. RepeatCountLimit can be used to suppress faulty alarms that trigger intermittently.
RepeatDecrementTimeThe time interval [seconds] between RepeatCount decrements. If RepeatDecrementTime is greater than 0, RepeatCount is decremented after every RepeatDecrementTime timeout. See RepeatCountLimit.
InputMaskThe mask that is AND'ed with the signal value before any Limit checking is done. Note that InputMask is unused when AlarmOperator type is float or double.
LimitHolds the threshold that is compared to the In value to generate the alarm. See LimitType, DelayOn, DelayOff, Deadband, InputMask and the examples for a visualization of Limit handling.
DelayOnDelayOn will delay setting the alarm for the time [seconds] specified in DelayOn. See the examples for a visualization of how DelayOn works.
DelayOffDelayOff will delay clearing the alarm for the time [seconds] specified in DelayOff. See the examples for a visualization of how DelayOff works.
DeadbandDeadband is a range or 'zone' where nothing happens. For the AlarmOperator, Deadband is used to delay the clearing of the alarm. See DelayOff, Limit, LimitType and the examples for a visualization of how deadband works.
ResetTimesActivatedWhen changed from 0 to 1, TimesActivated is reset to 0. See TimesActivated.

Properties

PropertyDescription
DescriptionThe description of the AlarmOperator.
RepeatCountThe number of times the alarm has been repeated since last start or acknowledgement.
RepeatBlockedIs set when RepeatCount>=RepeatCountLimit, and then blocks the alarm and sets the STATUS_REPEATBLOCKED flag.
LimitTypeSelection that specifies if the In value must be AboveOrEqual or Below the Limit value for the alarm to be triggered. In case of AboveOrEqual, the alarm is set when the input is greater than or equal to Limit. In case of Below, the alarm is set when the input is less than Limit. See also DelayOn, DelayOff, Deadband and InputMask
HandleThe handle of the AlarmOperator.
LastSetTimeThe time the alarm was last set.
TimesActivatedThe number of times the alarm has been activated. See ResetTimesActivated.
StatusThe alarm status as defined by statusbits (see AlarmDefines.h)
LevelHolds the alarm level which dictates the seriousness of the alarm. It can be Notify, Warning, Error or Emergency.
SetIndicates that the alarm is set.
TextThe text of the alarm. The alarm text can include CDPTag names formatted as '%name%'. These will be substituted with the corresponding tag value, searching from the alarm's own tags and moving up the hierarchy until the application level.
GroupThe group that this alarm belongs to. Alarm groups can be used to selectively visualize them.

When operator is used inside a signal its default input is automatically tied to signal's InternalValue or previous operator's output. Its default output is automatically tied to next operator's input or to signal's Value. See also CDP Operator Usage In CDP Signals.

Examples

Alarm when AboveOrEqual Value

Here is how the alarm behaves when the input signal varies, and the following settings are applied to the alarm:

NameValue
LimitTypeAboveOrEqual
Limit5

  1. When In value is above or equal to Limit the alarm is set.
  2. When In value is below Limit the alarm is cleared.

Alarm when Below Value

Here is how the alarm behaves when the input signal varies, and the following settings are applied to the alarm:

NameValue
LimitTypeBelow
Limit5

  1. When In value is below Limit the alarm is set.
  2. When In value is above or equal to Limit the alarm is cleared.

Alarm with DelayOn

Here is how the alarm behaves when the input signal varies, and DelayOn with the following settings are applied to the alarm:

NameValue
LimitTypeAboveOrEqual
Limit5
DelayOn0.5

  1. When In value is above or equal to Limit, the DelayOn timer is started.
  2. When the DelayOn time (0.5 seconds in this case) has passed, and the alarm condition is still present, the alarm is set, and the DelayOn timer is stopped.
  3. When In value goes below Limit, the alarm is cleared and the DelayOn timer is stopped.

Alarm with DelayOff

Here is how the alarm behaves when the input signal varies, and DelayOff with the following settings are applied to the alarm:

NameValue
LimitTypeAboveOrEqual
Limit5
DelayOff0.5

  1. When In value is above or equal to Limit, the alarm is set
  2. When In value goes below Limit, the DelayOff timer is started.
  3. When the DelayOff time (0.5 seconds in this case) has passed, and the value is below Limit, the alarm is cleared, and the DelayOff timer is stopped.

Alarm Limit AboveOrEqual with Deadband

Here is how the alarm triggers on value AboveOrEqual, with Deadband, when the input signal varies and the following settings are applied to the alarm:

NameValue
LimitTypeAboveOrEqual
Limit5
Deadband2

  1. When In value is above or equal to Limit, the alarm is set
  2. When In value goes below Limit - Deadband, in this case below 3, the alarm is cleared.

Alarm Limit Below with Deadband

Here is how the alarm triggers on value Below, with Deadband, when the input signal varies, and the following settings are applied to the alarm:

NameValue
LimitTypeBelow
Limit5
Deadband2

  1. When In value is below Limit, the alarm is set
  2. When In value goes above or equal to Limit + Deadband, in this case above 7, the alarm is cleared.

Alarm with OperatorBlocked

Here is how the alarm behaves when OperatorBlocked is applied, when the input signal varies and the following settings are applied to the alarm:

NameValue
LimitTypeAboveOrEqual
Limit1
OperatorBlockedManually set to 1 after the alarm has triggered two times.

  1. When In value is above or equal to Limit, the alarm is set
  2. When In value is below limit, the alarm is cleared.
  3. After triggering two times, OperatorBlocked is manually set to 1
  4. Subsequent triggering of the alarm when OperatorBlocked is set does not cause the alarm to be set.

Alarm with ProcessBlocked

Here is how the alarm behaves when ProcessBlocked is applied, when the input signal varies and the following settings are applied to the alarm:

NameValue
LimitTypeAboveOrEqual
Limit1
ProcessBlockedManually set to 1 after the alarm has triggered two times.

  1. When In value is above or equal to Limit, the alarm is set
  2. When In value is below limit, the alarm is cleared.
  3. After triggering two times, ProcessBlocked is manually set to 1
  4. Subsequent triggering of the alarm when ProcessBlocked is set does not cause the alarm to be set.

Conceptual Illustration of Deadband, DelayOn and DelayOff

  1. Input value is above or equal to Limit, but since DelayOn time is specified, the setting is delayed.
  2. DelayOn time is reached while alarm condition is still met. Alarm is set here.
  3. In value is below Limit - Deadband, so alarm should be cleared, but since DelayOff time is specified, clearing is delayed.
  4. DelayOff time is reached so alarm is no longer set here.

Actual Processing Code of the AlarmOperator

unsigned int AlarmOperator<T>::Process()
{
  d->If_Acked_AckAlarmAndClearRepeatBlockedAndRepeatCount();
  d->If_ResetTimesActivatedChangedTrue_ResetTimesActivated();

  d->SetOrClearOperatorBlockedStatus();
  d->SetOrClearProcessBlockedStatus();

  d->If_OperatorBlocked_UnackClearAndBlock();
  d->If_ProcessBlocked_ClearAndBlock();

  if(!d->IsBlocked())
  {
    d->DecrementRepeatCount();
    d->CheckHighLevelAndSetOrClearAlarm();
    d->CheckLowLevelAndSetOrClearAlarm();
  }
  d->If_StatusChanged_SendEventsAck_ClearOrSet();

  m_output = m_input;

  if (d->status!=d->lastStatus)
    if (auto parent = GetParent())
      parent->RunInComponentThread([=](){ parent->UpdateStatus(GetNodeID(), d->status); });

  d->StoreLastValues();

  return Status();
}

See also CDPAlarm and Argument.

Member Function Documentation

AlarmOperator::AlarmOperator(const CDPPropertyBase &in)

Constructs an AlarmOperator with input in.

[virtual] AlarmOperator::~AlarmOperator()

Destructs the AlarmOperator

[override virtual] void AlarmOperator::Configure(XMLPrimitive *pObjectElement)

[override virtual] void AlarmOperator::Create(const char *shortName, CDPBaseObject *pParent)

Reimplemented from CDPBaseObject::Create().

[override virtual] void AlarmOperator::CreateModel()

Reimplemented from CDPBaseObject::CreateModel().

[override virtual] void AlarmOperator::Destroy()

std::string AlarmOperator::GetExtendedData() const

[override virtual] const CDPPropertyBase &AlarmOperator::GetOutput()

Reimplemented from CDPOperatorBase::GetOutput().

Returns the input.

[override virtual protected] std::string AlarmOperator::GetProperty(std::string propertyName)

Reimplemented from CDPBaseObject::GetProperty().

[override virtual] unsigned int AlarmOperator::Process()

Reimplemented from CDPOperatorBase::Process().

[override virtual protected] int AlarmOperator::ReceiveMessage(void *message)

Reimplemented from CDPBaseObject::ReceiveMessage().

void AlarmOperator::SetExtendedData(const std::string &extendedData)

[override virtual] unsigned int AlarmOperator::Status() const

Reimplemented from CDPBaseObject::Status().

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top