Wonderware 2107 - Historian

mad4x4

Member
Join Date
Mar 2009
Location
ST CYrus
Posts
363
Any of the WW gurus know if it is possible to extract and alarm log from the historian in Wonderware. Were using WonderWare Historian 2017.

I would be looking for data in a CSV format like this .

On_Time,Off_Time,Ack_Time,Duration,ID,Area,System,Description,Category,Type,Age_in_Days



If I can get the raw data out I can sort / filter manipulate it to get the exact columns I need.

Anyone got some screenshots or documents on how to extract the logs.
 
SQL Server Management Studio

You can query the WW Historian db directly using standard T-SQL.
Open SQL Server Management Studio on your Historian and build up a query something like this (send results to .csv instead of the grid if you want to analyze elsewhere).

Code:
declare @start_date datetime2
declare @end_date datetime2

SET @start_date = '20190902 00:00:00:000'
SET @end_date = '20190908 23:59:59:000'

/* alarms query - recommend save to csv */
SELECT ID, Alarm_ID, EventTimeUtc, Alarm_State, Priority, Source_Area, Comment, Alarm_LimitString
  FROM [Runtime].[dbo].[Events]
  where eventtimeutc >= @start_date
  and eventtimeutc <= @end_date
  and IsAlarm = '1'
  and Alarm_State = 'UNACK_ALM'
  and Priority in (1, 4, 5, 10, 11)

-Trevor
 
If you have access to the database remotely you could use Excel to import the data, create a connection data source in control panel to the DB & save it.
Open a new spreadsheet & click the Data Tab, select from other data sources and connect to the DSN you created, Select the table then the fields you require, then the range i.e. date/time from to return the data to excel, then you can filter the data you require.
You can automate this, simply record a macro in Excel, do the above, end macro, go to VBA & you will have a basic version of the macro, you could add this to some VBA code where you use a date/time picker to select the start & end dates/time, modify the macro to insert the date/time in the SQL query & run it.
 
You can query the WW Historian db directly using standard T-SQL.
Open SQL Server Management Studio on your Historian and build up a query something like this (send results to .csv instead of the grid if you want to analyze elsewhere).

Code:
declare @start_date datetime2
declare @end_date datetime2

SET @start_date = '20190902 00:00:00:000'
SET @end_date = '20190908 23:59:59:000'

/* alarms query - recommend save to csv */
SELECT ID, Alarm_ID, EventTimeUtc, Alarm_State, Priority, Source_Area, Comment, Alarm_LimitString
  FROM [Runtime].[dbo].[Events]
  where eventtimeutc >= @start_date
  and eventtimeutc <= @end_date
  and IsAlarm = '1'
  and Alarm_State = 'UNACK_ALM'
  and Priority in (1, 4, 5, 10, 11)

-Trevor


Trevor, Thanks had a look at this and on our developement laptop that has windowmaker etc I can find the Microsoft SQL Managment Studio and when I connect I see an AchestraDB but the table [Runtime].[dbo].[events] doesn't exist neither does the WWAlarmdb table ?

I think this is what I need but can find the tables ? #confused
 
Microsoft SQL Management Studio would probably only be on the Historian server. But if you have the original WW SQL CD's you can install it from that. Also as mentioned above you can just run the query in Excel against the database.


Another question is are you sure you have Historian and not the just SQL alarm log? They are two separate things.
 
If you purchase "Historian Client", you can "mine" all that data pretty easily without having to enter a lot of SQL commands.
If it is SQL alarm log (WWALMDB), Wonderware makes a side program (Alarm Database Query Tool) that pull information from it.
 
Last edited:

Similar Topics

Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
149
Hello everyone, Recently, my Archestra IDE shut down while I was editing. After restarting the IDE, I noticed warning symbols under my opened...
Replies
1
Views
102
Good morning all. I'm working on a rehab where they had a standalone InTouch 2014 HMI that they called a SCADA, but it's really basic stuff. The...
Replies
4
Views
183
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
179
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
162
Back
Top Bottom