Versions Compared

Key

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

Download the Solution Example Here: AlarmChangeMessage.dbsln

Solution Name: AlarmChangeMessage

Software Version:  10.1


Summary

This solution example modifies the Alarm Message during Runtime.

Image Added


Technical Information

In the project citedthis solution, an alarm will trigger if is triggered when the value of Tag1 is set to 1. Additionally, and the message will change when if the value of Tag2 is set to 5 (or if it is was previously set to 5) - and will return revert to the previous text if it’s not 5 anymorethe value of Tag2 is no longer 5.
Such This change is done implemented through the display’s CodeBehind, where you can change adjust the properties of any Alarm Item as desired, and needed. The method used for this example , the method used is seen shown below.


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


The example also relies depends on knowing the tag state at any given moment. Therefore, therefore it runs on utilizes the “DisplayIsOpenDisplayIsOpen() method along with other Alarm properties, seen 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