# Has Alarms been added yet?

**URL:** <https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106>\
**Category:** Ignition Early Access\
**Tags:** ignition80\
**Created:** [November 28, 2018, 9:26am UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106 "2018-11-28T09:26:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oisin.gribben](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@oisin.gribben](https://forum.inductiveautomation.com/u/oisin.gribben)\
**Post date:** [November 28, 2018, 9:26am UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106/1 "2018-11-28T09:26:52Z")

</div>

Just wondering if alarm journals have been added yet

---

<div class="post-metadata">

**Author:** ![anjoroge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/anjoroge/32/6698_2.png) [@anjoroge](https://forum.inductiveautomation.com/u/anjoroge)\
**Post date:** [November 28, 2018, 4:54pm UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106/2 "2018-11-28T16:54:25Z")

</div>

Yes it has for 8.0 you can add it in the gateway and use it in the designer and should be working as expected as such you should be able to use the alarm journal table.

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [November 28, 2018, 11:13pm UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106/3 "2018-11-28T23:13:42Z")

</div>

An additional point, Alarm Journals are working in Vision but there is not currently a Perspective component that will take advantage of them.

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 15, 2019, 9:27pm UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106/4 "2019-02-15T21:27:52Z")

</div>

I had to do this so I figured I’d include my query because I figure it could help someone who searches the forums for displaying alarms in perspective before a control exists. All I did was data bind a data grid control to this query from the alarm journals tables. This code is TSQL so it is for Microsoft SQL Server.

SELECT  
SUBSTRING(AE.source, PATINDEX(’%alm:%’, AE.source) + 4, LEN(AE.source) - PATINDEX(’%alm:%’, AE.source)) AS Alarm,  
AE.eventtime AS Alarmed,  
(  
SELECT TOP 1 MAX(AEC.eventtime)  
FROM alarm\_events AS AEC  
WHERE  
AEC.eventtype = 1  
AND SUBSTRING(AEC.source, PATINDEX(’%alm:%’, AEC.source) + 4, LEN(AEC.source) - PATINDEX(’%alm:%’, AEC.source)) = SUBSTRING(AE.source, PATINDEX(’%alm:%’, AE.source) + 4, LEN(AE.source) - PATINDEX(’%alm:%’, AE.source))  
AND AEC.eventtime \> AE.eventtime  
) AS Cleared,  
(  
SELECT TOP 1 MAX(AEA.eventtime)  
FROM alarm\_events AS AEA  
WHERE  
AEA.eventtype = 2  
AND SUBSTRING(AEA.source, PATINDEX(’%alm:%’, AEA.source) + 4, LEN(AEA.source) - PATINDEX(’%alm:%’, AEA.source)) = SUBSTRING(AE.source, PATINDEX(’%alm:%’, AE.source) + 4, LEN(AE.source) - PATINDEX(’%alm:%’, AE.source))  
AND AEA.eventtime \> AE.eventtime  
) AS Acknowledged  
FROM alarm\_events AS AE  
INNER JOIN alarm\_event\_data as ED  
ON AE.id = ED.id  
WHERE AE.eventtype = 0 AND ED.dtype = 0  
ORDER BY AE.eventtime DESC

Basically, It’s just grabbing the alarm name (a subset of one of the fields) along with the date the alarm occurred. Then it uses a pair of sub queries to pull in alarm cleared and alarm acknowledged. You could easily add a date filter by adding parameters to the query and wiring them up to user inputs.

There might be a better way to do this but I didn’t see one with what little research I did into the alarm journal data layout. Notice that I am filtering for integer alarms only because all of my alarms were bits which come in as integer alarms.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [February 18, 2019, 11:56pm UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106/5 "2019-02-18T23:56:10Z")

</div>

Will an alarm journal viewer for the perspective module be included in the general release of v8?

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [February 19, 2019, 2:22pm UTC](https://forum.inductiveautomation.com/t/has-alarms-been-added-yet/21106/6 "2019-02-19T14:22:02Z")

</div>

This thread is the last update I've seen on it.

> [@Perspective Alarming work around](http://forum.inductiveautomation.com/t/perspective-alarming-work-around/21742):
>
> With the lack of Alarm components in perspective I was wondering what others have used for showing alarm status/events.

If you do that you'll have alarms in a logging table in your database. You can display a history of that by querying the table and displaying the results in a data grid control.

I wrote this query to display alarm information from the logging tables logging to a Microsoft SQL Server database (in case it's helpful to you). It just displays the alarm name, start time and end time. You could potentially get incorrect results if you have multiple alarms with the same name.

SELECT  
SUBSTRING(AE.source, PATINDEX('%alm:%', AE.source) + 4, LEN(AE.source) - PATINDEX('%alm:%', AE.source)) AS Alarm,  
AE.eventtime AS Alarmed,  
(  
SELECT TOP 1 MAX(AEC.eventtime)  
FROM alarm\_events AS AEC  
WHERE  
AEC.eventtype = 1  
AND SUBSTRING(AEC.source, PATINDEX('%alm:%', AEC.source) + 4, LEN(AEC.source) - PATINDEX('%alm:%', AEC.source)) = SUBSTRING(AE.source, PATINDEX('%alm:%', AE.source) + 4, LEN(AE.source) - PATINDEX('%alm:%', AE.source))  
AND AEC.eventtime \> AE.eventtime  
) AS Cleared,  
(  
SELECT TOP 1 MAX(AEA.eventtime)  
FROM alarm\_events AS AEA  
WHERE  
AEA.eventtype = 2  
AND SUBSTRING(AEA.source, PATINDEX('%alm:%', AEA.source) + 4, LEN(AEA.source) - PATINDEX('%alm:%', AEA.source)) = SUBSTRING(AE.source, PATINDEX('%alm:%', AE.source) + 4, LEN(AE.source) - PATINDEX('%alm:%', AE.source))  
AND AEA.eventtime \> AE.eventtime  
) AS Acknowledged  
FROM alarm\_events AS AE  
INNER JOIN alarm\_event\_data as ED  
ON AE.id = ED.id  
WHERE AE.eventtype = 0 AND ED.dtype = 0  
ORDER BY AE.eventtime DESC
