alarm banner with one line and multiple messages

Find and share HowTos to various installations / configurations!
7 posts • Page 1 of 1
tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

alarm banner with one line and multiple messages

Post by tmalone »

We have a customer who wants to upgrade an existing system to WinCC OA. The alarm system uses a single line that cycles through the message 1/second for all the active alarms (only the message). I would like to duplicate this method.

Can someone give me a clue where to start? I am sure there are some great scripting functions, but it is a big list to read through.

Todd Malone
Siemens HMI CoC USA

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: alarm banner with one line and multiple messages

Post by leoknipp »

Hello Todd,

you could use the panel vision/aes/AESRow.pnl as a reference panel.
With the attribute "lineCount" you can get the current number of lines in the table.
The visible line can be set with the attribute "lineVisible".
You could call these functions in a loop with a changing value for lineVisible.

You have to take into account that the number of lines can change when new alerts are added or old ones are removed.
I would implement it in that way that scrolling through the lines starts again with the newest line, if a new alert was raised during the last interval. Otherwise your customer will "never" see the newests alert if there are a lot of alert in the table.

Best Regards
Leopold Knipp
Senior Support Specialist

tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

Re: alarm banner with one line and multiple messages

Post by tmalone »

what call to use to know when a new alert is added to the list?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: alarm banner with one line and multiple messages

Post by leoknipp »

Hello,

you could use the function getColumnN() to get the information stored in the column with the timestamps.
From that list you read the newest time stamp. In the next interval you read again the information and compare the timestamps. If a newer timestamp is found you know that a new alert appeared.

Best Regards
Leopold Knipp
Senior Support Specialist

tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

Re: alarm banner with one line and multiple messages

Post by tmalone »

Slick technique and you get all the alarm features with the AESline object. Thanks for your help.

The tricky part is that you cannot have a timedFunc in the UI scripts. So, you have to have a timedFunc in a control that sets a bool. With that dpConnect on the bool, then you make the suggested calls from Mr. Knipp.

Here is the code that used:

Script in the control manager (timedFunc DPE is set for 2 seconds:

main()
{
// timer function for rotating alarm messages
timedFunc("NextAlarm", "AlarmMsgRotate");

}

// subroutine for alarm rotating messages
void NextAlarm(string dp, time t1, time t2)
{
dpSet("RotateAlarmMessage.", TRUE); // force bit to change for event in UI
}

Here is the new code for the panel: vision/aes/AESRow.pnl
Code is on the Initialize event of the table

// TM timer code, alarm count info
int MaxCount, CurrentCount;

main()
{

// ... leave the old code alone, just add the following

// TM code to create rotating messages at the interval specified by DPE AlarmMsgRotate.
dpConnect("NextAlarm", TRUE, "RotateAlarmMessage.");
}

// TM discover the total alarms, rotate through the list one at a time.
void NextAlarm(string dp, bool value)
{
if(MaxCount < CurrentCount) // start over with count
{
MaxCount = this.lineCount(); // total alarms at this moment
CurrentCount = 1; // start from top of list
}

this.lineVisible(CurrentCount); // display this alarm from the list
CurrentCount += 1;
}

tmalone
Posts:192
Joined: Mon Nov 22, 2010 11:21 pm

Re: alarm banner with one line and multiple messages

Post by tmalone »

HaHa, I found my own error. If the alarm values change and they disappear from the list, you might get an error from the table because the line does not exist any more. So, we should check the MaxCount each time change to see if the list has changed.

New code:

// TM discover the total alarms, rotate through the list one at a time.
void NextAlarm(string dp, bool value)
{
MaxCount = this.lineCount(); // total alarms at this moment
if(MaxCount < CurrentCount) // start over with count
{
CurrentCount = 1; // start from top of list
}

this.lineVisible(CurrentCount); // display this alarm from the list
CurrentCount += 1;
}

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: alarm banner with one line and multiple messages

Post by Gertjan van Schijndel »

Do all alarm banners have to scroll at the same time?
Otherwise you could also use a thread instead of the timedFunc.

7 posts • Page 1 of 1