OpenPDC Storing Data in SQLEXPRESS

I am trying to store data from openPDC into a SQLEXPRESS database. I have the created the database and openPDC is currently reading PMU data. I believe that I have the correct ouput set to a table in SQL called “TimeSeriesMeasurement” but when I query a number of rows from the table it returns nothing.

This is the connection string in openPDC:
“BulkInsertLimit=500; TableName={TimeSeriesMeasurement; IDFieldName=SignalID; TimestampFieldName=Timestamp; ValueFieldName=Value}”

Do you know which output adapter you are using to send data to the SQL database?

See the full list here:
https://www.gridprotectionalliance.org/adapters.asp#Database-Historian

Thanks,
Ritchie

1 Like

I am using the ADO output adapter:

I believe that the ADO adapter is working correctly because it has output the Phasor data seen here:

I added a second PMU to the simulation to verify.

When I query the TimeSeriesMeasurement table, nothing is returned because the table is empty:

That phasor data comes from the openPDC input configuration.

However, I don’t think your connection string is correct or complete for this adapter. First, your connection string should be formatted as follows, i.e., remove the curly braces:

BulkInsertLimit=500; TableName=TimeSeriesMeasurement; IDFieldName=SignalID; TimestampFieldName=Timestamp; ValueFieldName=Value;

Next, you also need to define the dbConnectionString and dataProviderString parameters.

These connection string parameters with associated values will likely look like the following for a local SQLEXPRESS database and will need to be added to your PPA connection string parameter in the Manage Historian Instances screen in the openPDC Manager:

dbConnectionString={Data Source=localhost\SQLEXPRESS; Initial Catalog=openPDC; Integrated Security=SSPI}; dataProviderString={AssemblyName={System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089}; ConnectionType=System.Data.SqlClient.SqlConnection; AdapterType=System.Data.SqlClient.SqlDataAdapter}

You should compare these connection string values to what you see in the openPDC.exe.config file just to be sure they match, see the systemSettings/ConnectionString and systemSettings/DataProviderString key values.

After you make these change I suggest running the openPDC Console Application, then typing init PPA into the console once connected (note that typed input is still being accepted even if interrupted by output text).

This init command will show any exceptions (in red coloring) that may be occurring with your ADO output adapter being purposed as a historian instance.

Good luck!
Ritchie

PS) Except for a small number of PMU inputs, an ADO data connection will quickly overwhelm SQL Server (and other traditional RDMS’ even faster). Do consider using a tool designed for high-speed synchrophasor data archiving, e.g., the openHistorian which has the ability to export data to CSV from its built-in web UI.

1 Like

Thanks Ritchie, with your help I was able to get it working. This project is is very small, but I will keep openHistorian in mind if I decide to increase the number of PMUs or run into problems with ADO.

Respectfully,
David