Configuration to get data from database

It’s saying that it couldn’t load the MySql.Data assembly (MySql.Data.dll) provided by the MySQL Connector/NET adapter. You may need to get the .NET & Mono build of MySQL Connector/NET which is labeled “Architecture Independent”, as the Windows version appears to be labeled x86/32-bit. It’s a no-install version so the assemblies won’t go into the global assembly cache. You’ll have to copy the assemblies into the openPDC folder.

Ok,

Well I’ve found MySql.Data.dll inside my MySql Connector and I’ve copy it inside openPDC folder, but I still have same error :frowning:

For MySQL Connector/NET, did you use the .NET & Mono build that is architecture independent, or the Windows installer that is 32-bit only?

Only Windows installer 32-bit

You still need the other one, even if you already have the 32-bit one installed.

I’ve donwload Mono from https://www.mono-project.com/download/stable/ and I’ve installed but it still doesn’t work

What could I do?

I’m talking about MySQL Connector/NET. You go to the download page, select .NET & Mono from the dropdown, and then download the zip file from there.

Here, I’ve done it myself and obtained the download link. Just use this link to download the correct version of MySQL Connector/NET that will work with 64-bit applications like the openPDC.
https://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-8.0.18-noinstall.zip

Stephen, I’ve downloaded it, I copied and I pasted all files inside openPDC folder but it still doesn’t work.

By the way, openPDC folder has another folders… Do I have to copy files in any that folders?

PD: inside openPDC folder I have next folders:
Statics
Logs
DatabaseScripts
ConfigurationCacheArchive

OpenPDC console:


OpenPDC Manager:

When I press initialize button from openPDC I’ve got that error in openPDC console.

If you downloaded the link I sent you, the version you should be using is 8.0.18, not 8.0.17. You’ll need to change your connection string accordingly.

Stephen

I’ve copied and pasted files from https://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-8.0.17-noinstall.zip inside openPDC folder and you remember I’ve installed Windows installer too.

So, now I’ve followed all your tips but I still not have success.

OpenPDC console send me same errors that you can watch in screenshot above.

One more thing, have you tried restarting the openPDC service after copying the assemblies for version 8.0.17 into the openPDC directory?

I’ve rebooted computer and now openPDC service has troubles

I’ve setup it again and now openPDC works fine :slight_smile:

I attach a screenshot of my new results

I dont know if it work yet, but I’ve got new results.
When I open database I watch that data doesn’t store there :frowning:

PD: There was a moment when openPDC send [CRITICAL], so I’ve disable connector for any problem.

The error message in your screenshot indicates either that the ADO output adapter is not able to send data to MySQL as fast as it is being received or that the output adapter is only queuing data and is not processing, perhaps due to an error during adapter initialization. Leaving the adapter on should not cause problems because it will be able to dump data from its queue before using up all your system memory, but you will continue to lose data until you can figure out a way to speed up the process.

Stephen

Now I’ve got next errors

Do I have NaN values from data arrives or Adaptor has problems?

Other question, When I make a new ADOAdapter it has a new RuntimeID.
How can I watch if RuntimeID is working??

Can you say me where can I find commands for openPDC console, please?

The only thing I can think is that you must have NaN values. The ADO adapter should be converting your measurements into SQL queries that look something like this…

INSERT INTO TimeSeriesMeasurement(ID, Timestamp, Value)
SELECT @p0, @p1, @p2 UNION ALL
SELECT @p3, @p4, @p5 UNION ALL
...

The @p# things in that query are parameters for a parameterized query. Likely, one of the parameters is a NaN value and the query is interpreting that as selecting the NaN column, which couldn’t possibly exist without a FROM clause, but really shouldn’t exist anyway since we’re only dealing with raw values here. Honestly, I wouldn’t have thought it possible if we were dealing with SQL Server, but I guess MySQL allows you to use parameter values as column names in your queries?

Regardless, since MySQL doesn’t support storing NaN in the database, you’ll have to either ensure that your input data can never be NaN or modify the AdoOutputAdapter code.

As for the runtime ID, use the list /o command to see what your output adapter runtime IDs are.

For a list of console commands, issue the help command. Use the /? modifier to get help using a specific command (for example, list /?).

So, I have some options to solve it.

About:
Regardless, since MySQL doesn’t support storing NaN in the database, you’ll have to either ensure that your input data can never be NaN or modify the AdoOutputAdapter code.
How can I modify it?
Do I have to do it in ConnectionString?

Another question is about add values to my database. You wrote it:

BulkInsertLimit=500; DataProviderString={ AssemblyName={MySql.Data, Version=8.0.17, Culture=neutral, PublicKeyToken=c5687fc88969c44d}; ConnectionType=MySql.Data.MySqlClient.MySqlConnection; AdapterType=MySql.Data.MySqlClient.MySqlDataAdapter }; DbConnectionString={ Server= localhost ; Database= MyDatas ; Uid= root ; Password= sincrofasor#1 }; TableName= TimeSeriesMeasurement ; IDFieldName= SignalID ; TimestampFieldName= Timestamp ;
ValueFieldName= Value; InputSourceIDs= PPA

If I want to add more data, How can I add it and how can I indicate which one (voltage, angle, so on)??
PD: I’ve noticed in connectionString a parameter InputMeasurementKeys and it has measureaments. Maybe there I must to get speficical data. (¿?)

The code is here:
https://github.com/GridProtectionAlliance/gsf/blob/master/Source/Libraries/Adapters/AdoAdapters/AdoOutputAdapter.cs

To modify the code you would have to download the Grid Solutions Framework source code, modify the AdoOutputAdapter.cs file, build the AdoAdapters project, locate the AdoAdapters.dll file in the build output, and then copy/paste that file into the openPDC installation folder, replacing the one that gets installed with the openPDC.


As for your question about adding values, the InputSourceIDs=PPA parameter ensures that your adapter receives all the same measurements as your primary phasor archive. If you’d like to add additional measurements, you can add them to your primary phasor archive by setting the Historian field on the Metadata > Measurements page of the openPDC Manager. You can also use the InputMeasurementKeys property to explicitly add them to your ADO adapter without adding them to your primary phasor archive.

Stephen,
I’m talking about add more values to my database using ConnectionString. I know that PPA has all measurements (voltages, angles and so on) but I don’t know how ConnectionString interprets measurements.

You wrote me one ConnectionString example just has three parameters: IDFieldName , TimestampFieldName and ValueFieldName, but ValueFieldName I don’t know what is (voltage, angle, frecuencie and so on?)

Now I’ve create another Table has more colummns. I’ll write it:

CREATE TABLE MyMeasurement
(
    SignalID NCHAR(36) NOT NULL,
    Timestamp VARCHAR(24) NOT  NULL,
    VPhase DOUBLE NOT NULL,
    APhase DOUBLE NOT NULL,
    Frequencie DOUBLE NOT NULL,
)

Now, I want to tell to connectionString writes into new table my new parameters.

PD: Voltage phase A, Angle phase A and Frecuencie

How can I do it?

Regards