Configuration to get data from database

I see at least one error here:

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= MyDatas ; Uid= root ; Password= sincrofasor#1 }; TableName= TimeSeriesMeasurements ; IDFieldName= SignalID ; TimestampFieldName= Timestamp ; ValueFieldName= Value ; InputSourceIDs= PPA04

According to your post, you called the table TimeSeriesMeasurement, singular and not plural.

That said, there could be other errors in your configuration that I can’t see from what you posted. For instance, why did you change the InputSourceIDs to PPA04? Is that really the name of your primary historian instance? Also, are you really using MySQL Connector/NET version 6.9.5? It’s a pretty old one, and I’m not sure you can even download it anymore.

For troubleshooting, I recommend using the openPDC Console to interact with the openPDC service to see errors and double-check the runtime configuration of your adapter. Hint: try using the list /o ADO command to see if it has any input measurements.

Stephen;

When I initial ADOAdapter I’ve got this error by console:

[PPA04] Could not load file or assembly ‘MySql.Data, Version=8.0.17, Culture=neutral, PublicKeyToken=c5687fc88969c44d’ or one of its dependenties.

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. (¿?)