This project has moved and is read-only. For the latest updates, please go here.

OpenPDC Readings

Nov 12, 2014 at 2:42 PM
Edited Nov 12, 2014 at 2:43 PM
Hello All,

I am currently working on a project that utilizes OpenPDC to read data from a grid we created.
OpenPDC successfully reads data and stores it in our database. However, the data being recorded is not understandable/humanly readable. Attached is a how the readings look in our GUI:


http://imgur.com/lSTKD67

http://imgur.com/VmSonK9

Currently only the alarms and error messages are correct. There are no errors with the grid and nothing that would set of an alarm as of now.

My question is: Is there a way to make these reading humanly readable? For example, is there a way to make "V" or Voltage read something like 20 Volts as opposed to V1YPM as OpenPDC is currently reading it? Thank you for the help!
Nov 13, 2014 at 3:03 PM
Hello iNoobCoder,

PMUs are designed to monitor power lines and send synchrophasor data to systems like the openPDC for analysis and archival. The openPDC shouldn't be able to take any of its own readings without some sophisticated custom development efforts.

That said, the openPDC stores measurement values as 64-bit floating point numbers in memory, so it should be impossible to get a reading of "V1YPM". Much like the values for P, I, and Q in your screenshot, it looks like that data may be coming from the openPDC's configuration as opposed to the actual measurement values.
  1. Is the openPDC supposed to be storing actual measurement values in your database to be displayed by your application?
  2. What adapter are you using to store the measurement values in the database?
  3. Is there a way for you to view the data in the database to verify that the openPDC is storing the information you expect to be able to see?
Thanks,
Stephen
Nov 24, 2014 at 4:10 PM
Edited Nov 24, 2014 at 4:34 PM
Stephen,

I apologize for the late reply. My team and I have been discussing things over with our product owner and trying multiple approaches first to ensure that we've done all we could and properly formulate an accurate response.

To answer your questions:
1) Yes. We were under the impression that openPDC would receive measurements from the various PMUs within our grid, compile the data, and then forward that information to the SQL Server we established for openPDC. When we first installed openPDC, we created a Windows authenticated SQL Server dedicated to storing voltage, power, current, etc. readings from the PMUs in the grid. When we open the SQL Server database and view the tables' contents, we get readings displayed in the images provided in our original post. This is why we are confused -- does openPDC actually write readable data to the database? Is openPDC writing usable data to another location we don't know about?

2) To answer your second question, please view the following images of the adapter settings we chose:
http://oi58.tinypic.com/35l8b6a.jpg
http://oi60.tinypic.com/2ebbvd2.jpg
http://oi60.tinypic.com/zvdieq.jpg

Initially we had the MySQL adapter (not sure why this was the default, since we chose SQL Server to be our database).
I then came across a post online that was using a CSV file to store values, and figured I would try using a CSV adapter instead (second image). The final image is of our adapter output settings. We do not know if any of these settings are correct. We have just been trying everything we can think of to find the file that openPDC is writing the grid measurements to, and tried to see if we could get the program to write to a CSV file (has not worked).

3) We can view the SQL Server database called "openPDC" but it contains a ton of tables that do not seem to hold any measurement values. The only information they store is the encoded data that we provided in our original post. This is our main issue - where is openPDC writing the valuable information we are seeking to use to assess our power grid?

If we were a real power company, how could we use openPDC to read voltage/current/power measurements from our power grid, then write these values to a database that can then be viewed by an administrator?

Thank you for your time, and again, we apologize for the delay in response. We have been working on this project diligently trying to find a solution but are currently lost.
Nov 26, 2014 at 6:10 AM
The behavior of the openPDC is almost entirely driven by its adapter configuration. In the case of phasor measurements, it will not send or receive any of that data without an adapter that is designed and configured to do so. The only built-in adapter that is able to write data to a SQL Server database is the AdoOutputAdapter. Below is the simplest configuration I could come up with.

First, open SQL Server Management Studio. In the Server Explorer, drill down to the openPDC database, select it, and then select "New Query" from the toolbars at the top of the window. Enter the following query into the editor window, then select "Execute" from the toolbars at the top of the window.
CREATE TABLE TimeSeriesMeasurement
(
    SignalID UNIQUEIDENTIFIER NOT NULL,
    Timestamp VARCHAR(24) NOT  NULL,
    Value FLOAT NOT NULL
)
In the openPDC Manager, under Outputs > Historians Instances...

Acronym: PPA
Name: Primary Phasor Archive
Type Name: AdoAdapters.AdoOutputAdapter
Assembly Name: AdoAdapters.dll
Connection String: BulkInsertLimit=500; DataProviderString={AssemblyName={System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}; ConnectionType=System.Data.SqlClient.SqlConnection; AdapterType=System.Data.SqlClient.SqlDataAdapter}; DbConnectionString={Data Source=localhost\SQLEXPRESS; Initial Catalog=openPDC; Integrated Security=SSPI}; TableName=TimeSeriesMeasurement; IDFieldName=SignalID; TimestampFieldName=Timestamp; ValueFieldName=Value

Make sure to save and initialize this historian, in that order. The measurements in the openPDC will then be written to the TimeSeriesMeasurement table, and may be joined with your metadata via the SignalID field.

Just now I tested this with the SHELBY sample device, and it may not scale well for large numbers of PMUs. If you find yourself running into scaling issues, you may consider using a time-series data historian such as the built-in historian included with the openPDC (HistorianAdapters.LocalOutputAdapter) or some custom adapter development using a more efficient mechanism to write data to SQL Server.

Thanks,
Stephen
Nov 26, 2014 at 5:07 PM
One more thing that I thought I should mention. The configuration I posted above was using a local instance of SQL Server with integrated security. If you are using a different setup, such as a remote instance of SQL Server, you will need to modify the DbConnectionString property of the AdoOutputAdapter's connection string. Make sure the openPDC has write access to the database.
Dec 2, 2014 at 4:37 PM
staphen,

Thank you for the assistance. OpenPDC now sends data that we were seeking to display using the SQL Server table you provided. We will try to figure out how to add additional elements to that table that we find relevant to our project and find a way to change the timestamps listed in the table, since they currently display readings with a year of 2068.

We will most likely be coming back to this discussion to ask further questions, so please do not forget about us! But thank you very much for the help you have provided so far, it's greatly appreciated.
Feb 10, 2015 at 7:07 PM
Hi Guys,

I have similar query. I setup MS SQL server as my database system. And during installation i used "Local Historian" as my primary historian. I tried to query stored PMU data in "SQL server management Studio" but i didn't found any raw phasor data. All I found Tables related to OpenPDC configuration info.
I tried to create a table and configure a new Historian instance as mentioned above. But I found no data update in SQL server. I do found *.d file which is in "openPDC\archive" folder which got update automatically and regularly.

Can you please guide me how to read stored PMU data in SQL server or any where else.

My objective:

I will use matlab to fetch these data and use for post processing. Matlab has builtin database connection tool which can connect and fetch data from MS SQL server or MySQL database system. So I need to know where my PMU data are currently stored and in which format/Table.

If you need further information please let me know. Thanks in advance.
Feb 10, 2015 at 7:49 PM
Hi hvpulok,

It sounds like your data is currently being archived by the openHistorian 1.0. The data is stored in the .d files you mentioned in a binary format that is described in the following document.

https://www.codeplex.com/download?ProjectName=openpdc&DownloadId=109343

There is also an API written in C# to read from and write to .d files (GSF.Historian.dll). You can refer to the HistorianView project or the HistorianPlaybackUtility project in the Grid Solutions Framework for an example of how to use it.

If you'd rather store your data in a SQL Server database, please follow the steps I outlined above on November 26, 2014.

Thanks,
Stephen
Feb 10, 2015 at 9:54 PM
Edited Feb 11, 2015 at 5:26 PM
Thanks a lot staphen. It finally worked. I had to change load order in Historian instances, since there were multiple historians.


I have another question.
I also created a custom output where I selected MySQL. I selected PMU measurements and initialized accordingly. Now can you help me please how to read these data. I mean there are no info where this database is stored. I tried to use MySQL workbench and connected to the server, but there are no schema related to openPDC. Thanks in advance.

http://1drv.ms/1MaA6BI
Feb 13, 2015 at 7:19 PM
Edited Jul 9, 2015 at 3:06 PM
The MySQL adapter is an extremely simple adapter designed to serve as an example of how to write an adapter. This adapter will only write measurements to a MySQL database if it contains a table called Measurement with the following definition.
CREATE TABLE Measurement(
    ID NCHAR(36) NOT NULL,
    Timestamp BIGINT NOT NULL,
    Value DOUBLE NOT NULL
);
Furthermore, the adapter isn't well optimized and only works for a handful of MySQL Connector/Net versions. I would highly recommend that you do not use it.


Instead, I would recommend using the AdoOutputAdapter, which should work for MySQL as well.

Acronym: PPA
Name: Primary Phasor Archive
Type Name: AdoAdapters.AdoOutputAdapter
Assembly Name: AdoAdapters.dll
Connection String: BulkInsertLimit=500; DataProviderString={ AssemblyName={MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d}; ConnectionType=MySql.Data.MySqlClient.MySqlConnection; AdapterType=MySql.Data.MySqlClient.MySqlDataAdapter }; DbConnectionString={ Server=localhost; Database=openPDC; Uid=openPDC; Password=openPDC }; TableName=TimeSeriesMeasurement; IDFieldName=SignalID; TimestampFieldName=Timestamp; ValueFieldName=Value

Note the places I marked in bold. You will need to change the version number to match your version of MySQL Connector/Net. You may also need to modify the DbConnectionString property to connect to your MySQL database with the proper credentials.

If you are setting this up as a CustomOutputAdapter (as opposed to a Historian), you will need to set the InputMeasurementKeys property the same way you did for the MySQL adapter in your screenshot.

Thanks,
Stephen
Aug 25, 2016 at 2:44 PM
Hello All,

i have a question about the Measurement GUID in the openPDC Manager. How can somebody change the ID of the measurement data e.g. frequency ID 3436e402-49b6-11e6-b909-f0def10300b3 (!!) ? It is namely not very convenient to write this long id in each SQL query. Except of that, is it possible to save measurements in different tables with one historian? Or should i create more than one historians and in this way save the measurements in different tables in the openpdc database?

Thanks in advance!

Best regards,
Eva
Aug 25, 2016 at 3:53 PM
Hello Eva,

Please note that the openPDC has moved from CodePlex to GitHub, and we have moved our discussions board elsewhere as well. We would appreciate it if you could move your query to the new discussion board so that we can answer it there. Feel free to link to this CodePlex discussion if you believe it is relevant.

GPA Product Discussions:
http://discussions.gridprotectionalliance.org/

openPDC Discussions:
http://discussions.gridprotectionalliance.org/c/gpa-products/openpdc

Thanks,
Stephen