Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

Download the Solution Example

Here

:

Alarm-ChangeMessage

AlarmChangeMessage.dbsln


  • Solution Name: Alarm
-ChangeMessage
  • Change Message
  • Software Version:
  10.0.6
  • v10
  • Keywords:
  Alarm. Message. Runtime.
  • Alarms, Message

Solution

Summary

This solution example is represented in HTML5 and WPF modifies the Alarm Message during Runtime.

Image Added


Technical Information

In this examplesolution, the Message appears when Tag1 = 1 for Primary State, when Tag2 = 5 the Message changes to Alarm is Locked.an alarm is triggered when the value of Tag1 is set to 1. Additionally, the message will change if the value of Tag2 is set to 5 (or if it was previously set to 5) and will revert to the previous text if the value of Tag2 is no longer 5.
This change is implemented through the display’s CodeBehind, where you can adjust the properties of any Alarm Item as needed. The method used for this example is shown below.


Code Block
@Alarm.Item.<Your alarm name>.Message = "Your custom message";


The example also depends on knowing the tag state at any given moment. Therefore, it utilizes the DisplayIsOpen() method along with other Alarm properties, as shown in the code snippet below.

Code Block
public void DisplayIsOpen()
{
    if (@Alarm.Item.ID0.State == 2)
    {
        if (@Tag.Tag2 == 5 && @Alarm.Item.ID0.Message == "Alarm Primary State")
        {
            @Alarm.Item.ID0.Message = "Alarm is Locked";
            @Tag.Tag1 = 1;
        }
        if (@Tag.Tag2 != 5 && @Alarm.Item.ID0.Message == "Alarm is Locked")
        {
            @Alarm.Item.ID0.Message = "Alarm Primary State";
            @Tag.Tag1 = 1;
        }
    }
}



Reference Information

→ For more information, check out CodeBehind.


In this section:

Page Tree
root@parent
spacesV10

The definition of an AlarmItem has 3 mandatory fields: TagName, Condition and AlarmGroup. That means, the Tag value that will be evaluated, the alarm condition to be verified, and if there is an Alarm, which AlarmGroup will guide the tag processing behavior.

To create or modify AlarmItems: Go to Alarms → Items.

In order to apply custom action using .NET scripts, subscribe to notifications of Alarms and events. These notifications are typically used to send SMS or email warnings, execute custom calculations, add custom notification Messages or audio Alarms, text-to-speech audio Alarms, and to perform any kind of action defined by custom programming.

Select the method in the Notification Method column on Alarms → Groups.

The name of the method can vary; The important is the expected parameters.

Reference Information

For more information, access the CodeBehind of the solution's MainPage display.

In this section...