Page 1 of 2
Alarm Banner
Posted: Tue Oct 02, 2012 2:59 am
by jcjelektro
Hello
Is it possible to make a Alarm banner (With the alarm text included)
- Emil
Re: Alarm Banner
Posted: Tue Oct 02, 2012 9:01 am
by mark.monroe
One way is to create a script in the alarm server and then write the alarm text to a tag. Then associate that tag with an AnalogNumeric box on your screen. What ever is in the tag is then displayed.
Code: Select all
public partial class AlarmServer
{
void Default_AlarmItem0_AlarmActive(System.Object sender, System.EventArgs e)
{
Globals.Tags.Tag1.Value = "My Alarm Text";
}
void Default_AlarmItem0_AlarmAcknowledge(System.Object sender, System.EventArgs e)
{
Globals.Tags.Tag1.Value = "";
}
}
Re: Alarm Banner
Posted: Tue Feb 12, 2013 3:42 am
by charlyprouteau
To continue this topic : I would like to know how can I write on a tag (string) the last active alarm appears to display it on a "text baneer". Could you help me?
Re: Alarm Banner
Posted: Tue Feb 12, 2013 5:12 am
by Edmund
You can create a banner (that shows the first active alarm).
Add a alarmviewer that you remove the column headers from and set the number of rows to 1 and handle set the filter option to hide normal alarms.
Below is a example I made from the alarm sample included in iX.
Re: Alarm Banner
Posted: Tue Feb 12, 2013 5:35 am
by charlyprouteau
I tried this solution but I can't modify the background color of the "alarm banneer" and it stays white... And I don't want white...
Re: Alarm Banner
Posted: Tue Feb 12, 2013 5:56 am
by Edmund
Sorry, the first poster just asked for a alarm baner
No there is no way of changing the background color in this version, but from what I have heard from Beijer there will be more options avalible for the alarmviewer in future releases.
Best Reagards
Re: Alarm Banner
Posted: Tue Feb 12, 2013 6:36 am
by charlyprouteau
Yes but now, how can i do to have the last alarm appears on a string tag?
Re: Alarm Banner
Posted: Tue Feb 12, 2013 9:29 am
by mark.monroe
The below code will write the text "My Alarm Text" when AlarmItem0 becomes active. If you do that for each alarm, then the last active alarm will have its text displayed in Tag1.
Code: Select all
public partial class AlarmServer
{
void Default_AlarmItem0_AlarmActive(System.Object sender, System.EventArgs e)
{
Globals.Tags.Tag1.Value = "My Alarm Text";
}
void Default_AlarmItem0_AlarmAcknowledge(System.Object sender, System.EventArgs e)
{
Globals.Tags.Tag1.Value = "";
}
}
Re: Alarm Banner
Posted: Tue Feb 12, 2013 10:24 am
by charlyprouteau
But with this script code, if the first alarm is acknowledge, the string tag will be ' ' whereas the second alarm is active. I just want to read the first active alarm on the alarm viewer objet.
Re: Alarm Banner
Posted: Tue Feb 12, 2013 10:33 am
by mark.monroe
You are correct, there can be multiple alarms active, and that is why there is no active alarm tag. You are going to need to create an array and keep track of the alarms and when they are acknowledged or not acknowledged.
You can create a script module with a C# array and populate the array with any/all active alarms. Then when an alarm is acknowledged you will have to remove that item from the array.
You can use the AlarmItem0_AlarmActive and the AlarmItem0_AlarmAcknowledge events to populate/remove the array values.