As I do to make this

The user interface must have a window where you can form groups of alarms and save with a name for future reference, this will let you see only in the historical window alarms that the user has chosen.

Hi,

There are probably a few ways to do what you are asking, but a lot of it will depend on how good you are with SQL. To allow the user to define their own groups of alarms and pull them up later would not be too hard, IF you were very good with databases. So, the first point is this: the solution will be to use SQL with the alert log table, and not scripting or Ignition functions.

To be clear: in a previous thread, you asked how to query based on time. I answered with a video that showed binding a table to the Ignition queryAlertHistory function. This answer is different. Instead of using that, we will bind to a SQL Query that queries the database directly.

I will try to outline something easy that is close to what you want:

Step 1 - Groups of alarms. It is not possible in Ignition to put alarms into different “groups” exactly. However, you might be able to use different properties to get close. For example, the “display path” is a field that you can use any way you want, and is stored in the history table. So, lets say that for each alert, you put its “group name” in the display path field, like “Tank alarms” and “Pump alarms”.

Step 2 - Build a window.
Step 2a - Select the group - Normally, you would create a separate table in the database with a list of all possible groups. But, since I’m trying to keep my example as simple as possible, we will use the values from the alert history table.

  1. Create a Drop-down list.
  2. Bind its data property to a SQL Query:
SELECT DISTINCT displaypath FROM alert_log ORDER BY displaypath ASC

Step 2b - Query history based on the group
Add a table to the window. Bind its dataset to a SQL Query, like this:

SELECT * FROM alert_log WHERE displaypath='{Root Container.Dropdown.selectedStringValue}' order by ACTIVE_TIMESTAMP ASC'

Note: the part like “{Root…}” is where I clicked on the chain icon and found the drop down (that we created in step 1) text property.

Now, when you change which group is selected, the table query will run again and only select alerts with the select display name.

Hope this helps,

Here’s a video that does exactly what I described above. I’m doing this because I’m not sure how much you’ve used Ignition, and also as an experiment to see how useful it is for helping people.
[youtube]Gdu6lU2J4wI[/youtube]

Note: I’m also going to move this thread to “Design Help”, because that’s what this is. “Ignition Problems” are for things that aren’t working, bugs, etc., not for “how-tos”.

Regards,

I like it :thumb_right:

The video is very explanatory, but my question is whether the user can guada alarm history for later access them.

I’ll explain what I’m doing.

First: create an alarm history.

second, then realize a filter for alarm. in which you can choose by building, area and type of alarm.

third, make the choice of dates alarms

fourth: The user may manipulate these filters and save the history the user selects the filters and later accessed.

Note 1: The history has to be in Spanish

Note 2: With the filter by date, does not work since I changed to English history and I insist on it in Spanish.
I think you have to do as in the example I put in extras (Basic Example Project), makes a script. I do not understand how we do it

this is what I have to make.

I’m sorry, but I don’t understand what you mean by “history in spanish” vs. “history in english”, and what didn’t work.

As I understand it, this is what you want to do:

  1. Have alerts stored to the database. This is done with the “database storage profile”, and goes by default to the “alarm_log”. That is what I’ve been using in the examples.

  2. Show the history filtered on time, and parameters, like building, area and type.

  3. Allow the user to save those parameters as a view so that they can view them again later.

I don’t understand what doesn’t work in spanish. You can name the alerts in spanish, and set the display paths to whatever you want. What is an example of something that works in english but not spanish?

Let me know if my description is correct, and we can go from there.

Regards,

  1. Have alerts stored to the database. This is done with the "database storage profile ", and goes by default to the "alarm_log. " That Is What I’ve been using in the examples.

this is correct

  1. Show the history filtered on time, and parameters, like building, area and type.

this is correct

  1. Allow the user to save Those parameters so as to view Them That They CAN view again later.
    this is correct, this can be done. how?

with respect to the alarm history in Spanish and solve it.

Now we just need to filter alarms by date, but not how to do it

Then there any way to save the alarm?

Hi
I would like to know how did this Script

if anyone knows please help me.

SCRIP app

def activeAlerts():
import system
return system.alert.queryAlertStatus(activeAndUnacked=1).rowCount

def alertHistory(profile, startDate, endDate, showCleared):
import system
return system.alert.queryAlertHistory(profile, startDate, endDate, activeAndUnacked=1, activeAndAcked=1, clearAndUnacked=showCleared, clearAndAcked=showCleared)

This script comes in the example is in extras, (Basic Example Project.proj).