Results 1 to 14 of 14

Thread: Niagara 4 Alarm Report for previous day

  1. #1
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes

    Niagara 4 Alarm Report for previous day

    Hi all!

    Hoping for some help. I am trying to come with a BQLGrid to include in a report that will list all alarms that occurred on the previous day. The idea is to run the report at say 6am and send an email to the techs that shows all alarms that occurred on the previous day.

    I have spent 5 or 6 hours so far playing with all kinds of BQL queries, but so far I get nowhere! I tried putting the Alarm DB view in a blank report px file, but the px editor doesn't allow it. The closest I have come is the following:

    alarm:|bql:select timestamp,user,alarmData

    If I hit the "right arrow" to generate a Collection table this generates the expected table, but this will not run as a grid table, but it does generate a "HTML5BqlGridTable"!!! The error when trying to generate a grid table is that the "Missing scheme name: NULL" I am guessing this is because there is no "from" clause. I have tried everything I can think of as a reasonable from clause and nothing works!

    If anybody can help I will be very grateful!

    Thanks,
    Tim

  2. #2
    Join Date
    Mar 2018
    Posts
    215
    Post Likes
    Just an Idea. In the alarm database cant you select the date, then when its showing all the alarms of that date, you could export that to a csv file? Now how to automate that Im unsure, I havent had to automate file exporting yet, but maybe you can find out.


    Sent from my iPhone using Tapatalk

  3. #3
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes
    Thread Starter
    Quote Originally Posted by bolt950rider View Post
    Just an Idea. In the alarm database can’t you select the date, then when it’s showing all the alarms of that date, you could export that to a csv file? Now how to automate that I’m unsure, I haven’t had to automate file exporting yet, but maybe you can find out.


    Sent from my iPhone using Tapatalk
    Yes, you can do that very easily, I was just thinking that it's always easier if the data goes to the people rather than relying on the people going to the data. Hence I thought I could just write a report file and have it run at say 6am and email the previous days alarms. It seems we get quite a few alarms that are momentary, such as DAT going out of range and then returning to normal.

    Strangely enough, it's quite easy to get a report that shows any points that are in alarm at the time the report is run. But in my opinion that doesn't tell the whole story.

  4. #4
    Join Date
    Sep 2002
    Location
    Hampton Roads, Virginia
    Posts
    2,023
    Post Likes
    Quote Originally Posted by VAEngineer View Post
    Hi all!

    Hoping for some help. I am trying to come with a BQLGrid to include in a report that will list all alarms that occurred on the previous day. The idea is to run the report at say 6am and send an email to the techs that shows all alarms that occurred on the previous day.

    I have spent 5 or 6 hours so far playing with all kinds of BQL queries, but so far I get nowhere! I tried putting the Alarm DB view in a blank report px file, but the px editor doesn't allow it. The closest I have come is the following:
    alarm:|bql:select timestamp,user,alarmDate where timestamp = bqltime.yesterday

    If I hit the "right arrow" to generate a Collection table this generates the expected table, but this will not run as a grid table, but it does generate a "HTML5BqlGridTable"!!! The error when trying to generate a grid table is that the "Missing scheme name: NULL" I am guessing this is because there is no "from" clause. I have tried everything I can think of as a reasonable from clause and nothing works!

    If anybody can help I will be very grateful!

    Thanks,
    Tim
    The notation I added should narrow your results down to "yesterday", but sorry no idea on the no scheme name problem.

    Kevin

    Controls is a lifestyle not a job

  5. #5
    Join Date
    Sep 2002
    Location
    Hampton Roads, Virginia
    Posts
    2,023
    Post Likes
    Sorry I believe it should be where timestamp in bqltime.yesterday

    Controls is a lifestyle not a job

  6. #6
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes
    Thread Starter
    Quote Originally Posted by klrogers View Post
    Sorry I believe it should be where timestamp in bqltime.yesterday
    Thanks for that little trick, amazing how little of this is actually in the documentation! I still haven't figured out the "NULL scheme" thing. I am wondering now if it is just that the BQL code doesn't like handling the alarm database for some reason. or it could be the code can't figure out how to cast the data from the alarm db into a grid. This shouldn't be this hard!

  7. #7
    Join Date
    Jan 2002
    Location
    Fort Worth\Dallas, Texas
    Posts
    2,002
    Post Likes
    You should be able to do this with the VykonPro module if you have it. Open the report folder in VykonPro and drag out theAlarmQueryToCsv. Open the property sheet and replace the Alarm Query field with selectbqltime.yesterday,user,alarmData. Set the time you want it to generate in the schedule property of the AlarmQueryToCsv. Link this to an email recipient.

    I tested this and it worked if I understand you goals.
    Go Rangers!

  8. #8
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes
    Thread Starter
    Quote Originally Posted by lwarren View Post
    You should be able to do this with the VykonPro module if you have it. Open the report folder in VykonPro and drag out theAlarmQueryToCsv. Open the property sheet and replace the Alarm Query field with selectbqltime.yesterday,user,alarmData. Set the time you want it to generate in the schedule property of the AlarmQueryToCsv. Link this to an email recipient.

    I tested this and it worked if I understand you goals.
    Thanks! I will try it tonight!

  9. #9
    Join Date
    Mar 2016
    Location
    Queensland
    Posts
    233
    Post Likes
    I am experimenting with the AlarmQueryToCsv to extract some alarms from a specific time & day for the client. So far I haven't been able to work out how to do it, although I expect it's a matter of finding the correct expansion on lwarren's suggestion above. Can anyone help, please?

  10. #10
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes
    Thread Starter
    select timestamp as 'timestamp', source, alarmData where timestamp in bqltime.yesterday

    The above is what I run for yesterdays alarms, if you need a certain date and time you would change the part starting with "in" to "between" and use the starting and ending time.

    If these dates are fixed, than why wouldn't you just go to the alarm console and filter it by date? You could then export it from there.

  11. #11
    Join Date
    Mar 2016
    Location
    Queensland
    Posts
    233
    Post Likes
    Thanks VAEngineer.

    It's EC-Net 3.8 & doesn't have the ability to export from the console as far as I can find. Maybe I'm blind?
    You can export from either the Alarm DB or DB Maintenance, but only to Obix. And none of them will allow a copy & paste operation.

  12. #12
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes
    Thread Starter
    Quote Originally Posted by FreezerGeezer View Post
    Thanks VAEngineer.

    It's EC-Net 3.8 & doesn't have the ability to export from the console as far as I can find. Maybe I'm blind?
    You can export from either the Alarm DB or DB Maintenance, but only to Obix. And none of them will allow a copy & paste operation.
    You have to use the alarm console view, click on the filter and choose the filter. When you have the date range you want in the upper right will be a little tiny icon, it so small you may have never noticed it. If you click on that you can export it.

    NOTE: You have to be using workbench to see that little icon, it doesn't work if your using the web viewer of the supervisor. At least this is for the N4 version of workbench, when I get back monday to work I will check if the AX version has the same things

  13. #13
    Join Date
    May 2016
    Location
    Upstate NY
    Posts
    272
    Post Likes
    Thread Starter
    Name:  ax alarm.jpg
Views: 54
Size:  1.84 MB

    See that little button that I circled, it should be there to let you export stuff. I couldn't log in to check my AX 3.8 JACEs but I found this picture on the interwebs pretty quick.

  14. #14
    Join Date
    Mar 2016
    Location
    Queensland
    Posts
    233
    Post Likes
    That is brilliant! Thanks ever so much, VAEngineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •