Script to filter alerts
Search
Script to filter alerts
Hello,
I have added a combo box "Priority" above my AEScreen to filter alerts by priority. I want to add a script to the event "Changed" of my combo box. May I have an example of script to filter alerts ? I really need to do this by script because I will have to add other filters and then use the same logic.
Thanks,
I have added a combo box "Priority" above my AEScreen to filter alerts by priority. I want to add a script to the event "Changed" of my combo box. May I have an example of script to filter alerts ? I really need to do this by script because I will have to add other filters and then use the same logic.
Thanks,
Re: Script to filter alerts
Hello,
if you want to apply a specific filter for the alerts in the AEScreen you have to use some (undocumented) internal functions for the AEScreen.
The settings for the AEScreen are written to an internal datapoint. The AEScreen reacts on the settings and starts a new query again with the new filter settings.
There is no simple example available how to change the settings and to restart the AEScreen.
If the AEScreen shall be opened with a specific filter the function openAES() is used. The configuration which is passed as parameter is defined at the panel System Management --> Settings --> A&E - Row/Screen.
For details please have a look at the online help.
Best Regards
Leopold Knipp
Senior Support Specialist
if you want to apply a specific filter for the alerts in the AEScreen you have to use some (undocumented) internal functions for the AEScreen.
The settings for the AEScreen are written to an internal datapoint. The AEScreen reacts on the settings and starts a new query again with the new filter settings.
There is no simple example available how to change the settings and to restart the AEScreen.
If the AEScreen shall be opened with a specific filter the function openAES() is used. The configuration which is passed as parameter is defined at the panel System Management --> Settings --> A&E - Row/Screen.
For details please have a look at the online help.
Best Regards
Leopold Knipp
Senior Support Specialist
-
- Posts: 25
- Joined: Sun Nov 06, 2016 2:02 pm
Re: Script to filter alerts
Hello.
I am trying to find a way to insert specific filter to the AES screen. For example when i push a button i want to open the AES with openAES() Command with my configuration, but in my configuration and in the DPlist filter i like to put a specific Datapoint name and the AES showing the alerts only for this DP.
is this possible ;;
Thanks a lot.
I am trying to find a way to insert specific filter to the AES screen. For example when i push a button i want to open the AES with openAES() Command with my configuration, but in my configuration and in the DPlist filter i like to put a specific Datapoint name and the AES showing the alerts only for this DP.
is this possible ;;
Thanks a lot.
Re: Script to filter alerts
Yes it is possible and yes there is an example.
The Lab Section holds a document 'XFile 10 - The Alarm'.
It will show how to define a custom AES definition and how to open it
Good luck
Share the fun
Frenk Mulder
The Lab Section holds a document 'XFile 10 - The Alarm'.
It will show how to define a custom AES definition and how to open it
Good luck
Share the fun
Frenk Mulder
-
- Posts: 25
- Joined: Sun Nov 06, 2016 2:02 pm
Re: Script to filter alerts
Thanks you very much Frenk Mulder , filters works perfect for my AES Screen.
Now i have an other issue. I want to insert a column to my AES Row that shows the full user name (not user ID) when i acknowledge an alert.
Is this possible using add_value parameter or is an other easier solution.
Now i have an other issue. I want to insert a column to my AES Row that shows the full user name (not user ID) when i acknowledge an alert.
Is this possible using add_value parameter or is an other easier solution.
Re: Script to filter alerts
I'm sorry. I'm afraid that there is no 'simple' solution.
The C++ API has an example called 'SampleTabUtil' that is used to implement additional columns in the AES table.
The most efficient way and the one that will cost you the least amount of time, is implementing the SampleTabutil. If you decide to make your own alarm screen, then you will probably spend much more time ! Building an alarm screen is not easy !
Good luck
Frenk
The C++ API has an example called 'SampleTabUtil' that is used to implement additional columns in the AES table.
The most efficient way and the one that will cost you the least amount of time, is implementing the SampleTabutil. If you decide to make your own alarm screen, then you will probably spend much more time ! Building an alarm screen is not easy !
Good luck
Frenk
Re: Script to filter alerts
Hi, we're after the same functionality, showing the user name that has acknowledged the alert on the alarm screen. Are there any plans to add this in a future version?
Thanks,
Ellen
Thanks,
Ellen
Re: Script to filter alerts
It is planned for a future version.
When it will be implemented is not defined right now.
Best Regards
Leopold Knipp
Senior Support Specialist
When it will be implemented is not defined right now.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: Script to filter alerts
Again. This is something that you can 'easily' do by yourself but You'll have to use Visual Studio to compile the AESTabUtil.
* Check out the lab section and look at XFile number 5 'The extension'. It will show you how you compile stuff using the WinCC OA API
* Look at : C:\\Siemens\\Automation\\WinCC_OA\\3.14\\api\\SampleTabUtil. File SampleTabUtil.cxx for an example
* Look in the help file and search for "Example of how to add a user-defined column"
In your case:
* You'll have to pass _alert_hdl.._ack_user to the function in your(!) AESTabUtil
* You can use the C++ method Manager::getUserName() to turn the integer into a string
Hope this points you in the right direction. The C++ AESTabutil is the most performant way to do this.
Can it also be done using scripting ?
Yes, I actually think that you could. When you check out the AES.ctl script code then you'll find !
This means that could implement a script function called 'editAlertsBeforeDisplay' and it allows you to modify the columns of the alerts before they are being sent to the AES table. You'll have to check out the contents of the variable 'gconfigMatrix' (to figure out what column to change) and then modify the 'cells' in xtab !
Hope this helps
Share the fun !
Frenk Mulder
* Check out the lab section and look at XFile number 5 'The extension'. It will show you how you compile stuff using the WinCC OA API
* Look at : C:\\Siemens\\Automation\\WinCC_OA\\3.14\\api\\SampleTabUtil. File SampleTabUtil.cxx for an example
* Look in the help file and search for "Example of how to add a user-defined column"
In your case:
* You'll have to pass _alert_hdl.._ack_user to the function in your(!) AESTabUtil
* You can use the C++ method Manager::getUserName() to turn the integer into a string
Hope this points you in the right direction. The C++ AESTabutil is the most performant way to do this.
Can it also be done using scripting ?
Yes, I actually think that you could. When you check out the AES.ctl script code then you'll find !
Code: Select all
res=convertAlertTabEx2( tab, g_configSettings, g_configMatrix, xtab, xtab2, diFontAttr );
//DebugTN(__FUNCTION__,__LINE__,"result of convertAlertTabEx2",dynlen(xtab[1]),dynlen(xtab[2]));
//new feature 'userdepending alarm display' IM #117931
if(isFunctionDefined("aes_editAlertsBeforeDisplay") &&(screenType != AESTYPE_EVENTS))
aes_editAlertsBeforeDisplay(g_configMatrix, xtab);
Hope this helps
Share the fun !
Frenk Mulder
Re: Script to filter alerts
Hi, I've found this topic cause I'll need to customize a filter on openAES function, but I cannot find the XFile 10 mentioned or any useful example.
thanks