Getting data from openHistorian/ openPDC to MATLAB

Hi,
I am trying to get real-time data into Matlab from openHistorian/openPDC.
I have tried using MySQL database, But in MySQL database, I am getting only configuration files of openPDC/ OpenHistorian.
How can I acquire data (Not configuration files) from openPDC/openHistorian to MySQL database?
Please suggest something.

Sugandh

Hi Sugandh,

If you must use MySQL, I would suggest trying out AdoOutputAdapter or creating your own custom adapter. You may also consider trying out openECA to get real-time data into a MATLAB project.

FYI, if you want to try openECA, there seems to be issues with the latest release so you may need to use the nightly build version. See the following topic for details.

Thanks,
Stephen

1 Like

Thank You Stephen,
I am using AdoOutputAdapter to store data into MySQL database then extracting that data into MATLAB using MySQL ODBC connector.
The following discussion, I used to setup AdoOutputAdapter.

First I created TimeSeriesMeasurement in MySQL in openPDC database.

CREATE TABLE TimeSeriesMeasurement(
SignalID NCHAR(36) NOT NULL,
Timestamp VARCHAR(24) NOT NULL,
Value DOUBLE NOT NULL
);

Then I run the following commands in Command prompt.
mysql -uroot -p
USE openPDC
SELECT * FROM TimeSeriesMeasurement;

When I query for most recent row FROM TimeSeriesMeasurement table It takes more than 30 sec to give that data because the TimeSeriesMeasurement table is very big in size.

Is this possible to get the most recent data from TimeSeriesMeasurement table.

You’re looking for a query with the max Timestamp for every SignalID. Please refer to the following link for strategies on how to construct such a query.

1 Like