This project has moved and is read-only. For the latest updates, please go here.

Some signals seem to miss my custom adapter processing

Apr 20, 2011 at 2:58 PM

I have a simple custom action adapter that adds 1 to frequency value.

using TimeSeriesFramework;
using TimeSeriesFramework.Adapters;

namespace MISO.AdapterLibrary
    public class CustomActionAdapter : ActionAdapterBase
        protected override void PublishFrame(TimeSeriesFramework.IFrame frame, int index)
            foreach (IMeasurement measurement in frame.Measurements.Values)
                measurement.Adder = 1;

My custom adapter has a filter to filter by device and signalType = 'FREQ'.

I notice on openPDC Manager => Input Status and Monitoring that there are 2-5 signals in every 5 seconds randomly not getting adjusted with the Adder = 1. When I added a few OnStatusMessage() lines, the number of signals that did not get adjusted increased. I would like to get some insight on why these signals miss the processing in my custom adapter. Thanks!


Apr 21, 2011 at 1:27 PM

You should be able to achieve this just by setting Adder value to 1 in Measurement table for all frequency measurement. This way get AdjustedValue call will automatically honor this setting.

Or in your action adapter set "measurement.AdjustedValue += 1;".


Mehul Thakkar

Apr 21, 2011 at 1:56 PM

Thanks for the response. My goal is not to just add 1 to the value. I was just trying to create and use custom action adapter. In this process I found that some signals missed going through my custom adapter code. That is still not clear why. Could you please give some insight on that? If I could email you the screenshot of what I'm seeing in Input Status and monitoring, it would be clearer to you what I mean by some signals do not go through custom adapter code. Thanks

Apr 21, 2011 at 2:44 PM

Would be helpful to see the adapter status to see what the concentration statistics look like - thanks!

Jun 30, 2011 at 6:58 PM

Hi Ritchie, While working on other things, I noticed some behavior that might explain why I saw some signals missing the Adder = 1 in this above mentioned issue. Would like to run it by you.

In this custom adapter code, I'm not raising OnNewMeasurements after adjusting the Adder, the signal could be created by the input adapter and OnNewMeasurements raised by the input adapter and if the custom adapter already sets the Adder = 1 for a signal before the EventHandler (serviceHostBase.RoutedMeasurementsHandler) operates on that signal, the adder value gets sent through in the measurement getting queued and the pub/sub sends the adjusted value through. But if the custom adapter process was slower and the signal already was handled in the RoutedMeasurementsHandler before the custom adapter set the adder on the measurement, the original measurement was published as such and the Adder value was lost.

I guess this is why I noticed more signals with adder not set when I added a wider input measurement filter to the custom adapter or when there was more code to process in the custom adapter.

If this understanding is correct, do I need to call the "OnNewMeasurements" after adjusting an existing signal and make sure the publisher ignores the original signal (because otherwise we would have 2 signals - the original and the adjusted one coming through and while time aligning only one of them will be sent forward)? Could you please provide some explanation regarding this and how we can handle scenarios where we need to update the existing signal and send it forward.


Sep 9, 2011 at 9:19 PM

Him Uma - just seeing this, sorry for the delayed response. Is this still an issue for you?