This project has moved. For the latest updates, please go here.

No data in the database, using an AdoAdapter

Jan 9, 2013 at 6:41 PM
Edited Jan 10, 2013 at 4:36 PM

Background: I’m able to connect a PMU with openPDC and receiving data (in the Configuration Setup Utility I left the default Local historian)

Objective: I need to save the measurements in a database
I followed the wiki and these links provided by staphen
http://openpdc.codeplex.com/discussions/250285

http://openpdc.codeplex.com/discussions/255282

http://openpdc.codeplex.com/discussions/285047

1. In the openpdc database I created a simple table (I’ve seen how to do it in some discussions

USE openpdc;
CREATE TABLE MeasurementTest (

SignalID NCHAR(36) NULL,
Timestamp BIGINT NOT NULL,
Value DOUBLE NOT NULL);

2. In Adapters/Output Adapters I choose a ADO with this connection string:

tableName=MeasurementTest; SignalIDFieldName=SignalID; TimestampFieldName=Timestamp; TimestampFormat=dd-MM-yyy HH:mm:ss.fff; dbConnectionString={server=localhost;port=3306;protocol=tcp;database=DatabaseName; uid=root; pwd=’mysqlpwd’}; DataProviderString={AssemblyName={MySql.Data, Version=6.2.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d}; ConnectionType=MySql.Data.MySqlClient.MySqlConnection; AdapterType=MySql.Data.MySqlClient.MySqlDataAdapter}

Enable/Save/Initialize

3. Then Adapter/Historians/clear
TypeName=AdoAdapters.AdoOutputAdapter
AssemblyName=Ado.Adapters.dll
ConnectionString=null
Enable/Save/Initialize

4.  Then I configure the device through the wizard (with PMU connection tester) and it uses the historian defined in 3 (Enable/save/Initialize)

The issue: in the Console I read:
[My historian] Disconnected
[My historian] Attempting connection..
[My historian] Connection attempt failed: the ConnectionString property has not been initialized

The only thing I can do is to initialize the historian again but it doesn’t help.
here a screenshot of the openPDC console and Manager:  http://postimage.org/image/b1uh3gpvr/

Where am I wrong? Sorry for the length of the post, but I read everything that could be read and I still don’t have a solution.
Thanks,

Marco 

Coordinator
Jan 16, 2013 at 3:01 PM

Might check your ErrorLog.txt for more specific messages. Also check that your MySQL version in the data provider string number matches the vesion installed on the openPDC machine.

Alternately you can use the MySQL adapter to create a MySQL historian. Any reason why the buil-in historian won't work for you?

Thanks!
Ritchie

Jan 17, 2013 at 11:08 AM

Thanks for the answer Ritchie,

I managed to write in the MySql database with an Ado historian, using this string (hope it will be useful for those who still have problems):
tableName=MeasurementTest; KeyFieldName=Measurement Key; TimestampFieldName=Timestamp; TimestampFormat=dd-MM-yyy HH:mm:ss.fff; dbConnectionString={server=localhost;port=3306;protocol=tcp;database=DatabaseName; uid=root; pwd=’mysqlpwd’}; DataProviderString={AssemblyName={MySql.Data, Version=6.2.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d}; ConnectionType=MySql.Data.MySqlClient.MySqlConnection; AdapterType=MySql.Data.MySqlClient.MySqlDataAdapter}

1. I'd like to use a MySQL adapter, as you suggested, instead of the Ado Historian so I can use the OutputMeasurement={PPA:X,PPA:Y}. I tried to configure it but I really don't understand the steps to follow, correct me if I'm wrong:
1a. Create an empty MySql historian
1b. Create MySQL output adapter and then enable it ( I m stuck in the connection string for this adapter. I know there are guides, but how can I specify the database fields as I did with the Ado Historian?

2. The main idea is to receive data from PMUs, save it in a database (almost accomplished when I ll be able to solve point 1) and then retrieve it as fast as possible using Matlab (every 20 ms supposing I m storing them at 50 frame per second)  . For this second part I read something about the Historian 2.0 and PI (that I don't really know, so far).

Could someone give me an hint or put me in the right track, so I can start looking for information about how to retrieve data from openPDC to Matlab in the fastest way possible.

Thanks in advance,
Marco