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

OpenPDC to other Apps, Real-time

Feb 22, 2016 at 8:11 PM
Hello,

I would like to know what is the best way to stream, in real-time, the extracted measurements and the time stamps to other applications (MATLAB, etc.).

I appreciate any suggestions,

Regards,

Reza
Coordinator
Mar 9, 2016 at 4:13 PM
Hello Reza,

I don't know about MATLAB, but the openPDC supports a protocol known as the Gateway Exchange Protocol that can be used to transfer data in real time over TCP or UDP to applications written in C#, C++, or Java. Here is some documentation for the C++ API which can help you get data from the openPDC into a C++ application.

https://github.com/GridProtectionAlliance/gsf/wiki/Gateway-Exchange-Protocol-(GEP)-Subscriber-API

Thanks,
Stephen
Mar 9, 2016 at 6:05 PM
Dear Stephen,

Finally, I decided to implement an Action Adapter to perform my algorithm. This algorithm is based on real time frequencies of multiple PMUs.
Now, while using GSF.TimeSeries.IMeasurement in my adapter, it seems that at some time stamps the data of some PMUs are missing. I guess it's mostly because of the delay of communication.
Does OpenPDC manager use a kind of buffer? Or am I wrongly reading the measurements?

Thanks,

Reza
Coordinator
Mar 9, 2016 at 8:02 PM
An action adapter that extends from ActionAdapterBase will use concentration to align measurement timestamps. The concentration engine sorts measurements into frames based on their reported timestamp. Frames will not be published until one of two conditions are met.
  1. Preemptive publishing is enabled and all measurements have been received.
  2. Time spent waiting for data to arrive has exceeded the concentrator's lag time.
Preemptive publishing and lag time are both connection string parameters defined by ActionAdapterBase so they can be adjusted. The default lag time is 3 seconds, and preemptive publishing is enabled by default.

Thanks,
Stephen
Mar 10, 2016 at 2:31 PM
I had to set the Lag/Lead times both to 10 seconds in order to get my Adapter to work! Setting them to the default values would cause N/A outputs.
Now, using historian, I receive the correct measurements and calculated values.
However, based on what you said about publishing the frames, I'm not sure if these calculations were published at the right time.
Let's say we want to use the calculated values as decision making parameters for a protection relay and that the relay must act as fast as possible (in real time with no waiting more than milliseconds).
In that case, what do you generally suggest?
1- Is there any way to override the existing publishing conditions?
2- Is it possible to perform for example an interpolation for the missing data at an instance?

I really appreciate your help,

Thanks,
Reza
Coordinator
Mar 14, 2016 at 1:59 PM
A protection relay that needs to react within milliseconds probably ought to use its own monitoring equipment to make decisions. That way, it won't be subject to network delays. If you must collect and sort data within such strict time requirements, you would need a high-speed, high-availability private network to transmit the necessary data to minimize transmission time.

Also of note is that synchrophasor measurements are essentially real-time aggregates. They stream at 30, 60, or 120 samples per second, and while I'm not 100% certain of how they are calculated, I suspect the magnitude is a root-mean-square of a full cycle of data, or maybe even two cycles of data. I believe you'd be lucky if you can detect an anomaly within 8 milliseconds of its occurrence.

As for your other questions:
  1. Certainly. I would recommend extending FacileActionAdapterBase and overriding the QueueMeasurementsForProcessing method. You will receive the data from each device as soon as it arrives, without concentration.
  2. I'm sure it's possible, but there is no functionality built into the openPDC to handle interpolation. You would need to use your own algorithm and implement it yourself.
Thanks,
Stephen
Mar 16, 2016 at 2:31 AM
Thank you so much Stephen!

Reza
Mar 24, 2016 at 3:53 PM
Dear Stephen,

While using exporting data as .csv using Historian, one can see that, for some certain time stamps, the measurements are NaN.
I'm working on an Interpolator Action Adapter and I'm using PublishFrame to evaluate different input measurements at each time stamp.

1 - The NaN values in .csv file, do they mean that at that certain time the measurements where not published by PublishFrame method?
If it is so, can I check them inside PublishFrame using for example " double.IsNaN(frame.Measurements.Values)) " ?

2 - Is there any easy way to implement an action adapter with variable number of outputs depending on the number of inputs measurements?
In all Sample Action Adapters that I saw so far, The number of outputs and their names are defined in the Members region and are fixed.

I would appreciate your help.


Reza