# ActionAdapter does not publish frames

**URL:** <http://discussions.gridprotectionalliance.org/t/actionadapter-does-not-publish-frames/988>\
**Category:** openPDC\
**Created:** [December 27, 2021, 7:52pm UTC](http://discussions.gridprotectionalliance.org/t/actionadapter-does-not-publish-frames/988 "2021-12-27T19:52:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrestrepo](http://discussions.gridprotectionalliance.org/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mrestrepo](http://discussions.gridprotectionalliance.org/u/mrestrepo)\
**Post date:** [December 27, 2021, 7:52pm UTC](http://discussions.gridprotectionalliance.org/t/actionadapter-does-not-publish-frames/988/1 "2021-12-27T19:52:11Z")

</div>

I have configured an ActionAdapter and i can see in the OpenPDC console this adapter is disposed but running, but when i tried to debbug the code, it never go into the PublishFrame function.

i have tried changed the .netFramework, use another OpenPDC version, send and read constant but nothing work to me.

Could you tell me what can i check?

> ```
> using System;
> 
> ```
> 
> using System.Collections.Generic;  
> using System.Linq;  
> using System.Text;  
> using System.Threading;  
> using System.ComponentModel;  
> using GSF.TimeSeries;  
> using GSF.TimeSeries.Adapters;  
> using GSF.Diagnostics;
> 
> namespace RAG\_Adapter\_OPDC2942  
> {  
> [Description(“RAG Adapter: Este es el adaptador para la prueba del Core para OpenPDC versión 2.9.49”)]  
> public class Rag : ActionAdapterBase  
> {  
> #region[parametros]  
> public int multiplicador = 2;  
> #endregion
> 
> ```
> //public override bool SupportsTemporalProcessing => throw new NotImplementedException();
> 
> public override bool SupportsTemporalProcessing => false;
> 
> protected override void Dispose(bool disposing)
> {
> 
> OnStatusMessage(MessageLevel.Info, "Both inputs were not available - could not calculate :-(");
> //OnStatusMessage(MessageLevel.Info, fasor1.Value.ToString());
> OnStatusMessage(MessageLevel.Info, multiplicador.ToString());
> 
> base.Dispose(disposing);
> 
> // Kill my database connections, etc...
> //m_database.Dispose();
> }
> 
> public override void Initialize()
> {
> base.Initialize();
> 
> OnStatusMessage(MessageLevel.Warning, "Logré inicializarme otra vez");
> }
> 
> protected override void PublishFrame(IFrame frame, int index)
> {
> IMeasurement fasor1 = frame.Measurements.Values.ElementAtOrDefault(0);
> IMeasurement fasor2 = frame.Measurements.Values.ElementAtOrDefault(1);
> IMeasurement fasor3 = frame.Measurements.Values.ElementAtOrDefault(2);
> 
> double resultado1 = (fasor1.Value + fasor2.Value + fasor3.Value) * multiplicador;
> 
> bool buenacalidad = fasor1.TimestampQualityIsGood() && fasor1.ValueQualityIsGood() && fasor2.TimestampQualityIsGood() && fasor2.ValueQualityIsGood() && fasor3.TimestampQualityIsGood() && fasor3.ValueQualityIsGood();
> 
> //if(resultado1 > 120 || resultado1 < 120)
> //{
> IMeasurement disparo = Measurement.Clone(OutputMeasurements[0], resultado1, frame.Timestamp);
> 
>         
>         
> //disparo.StateFlags = buenacalidad ? MeasurementStateFlags.Normal : MeasurementStateFlags.BadData;
> 
> OnNewMeasurements(new[] { disparo });
> //}
>         
> //throw new NotImplementedException();
> }
> 
> }
> 
> ```
> 
> }

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [December 27, 2021, 9:49pm UTC](http://discussions.gridprotectionalliance.org/t/actionadapter-does-not-publish-frames/988/2 "2021-12-27T21:49:05Z")

</div>

There are several important configuration parameters when dealing with an `ActionAdapter`, i.e., the `FramesPerSecond`, `LeadTime`, `LagTime`, `InputMeasurementKeys` and `OutputMeasurements`

See the following: [openPDC/Connection\_Strings.md at master · GridProtectionAlliance/openPDC · GitHub](https://github.com/GridProtectionAlliance/openPDC/blob/master/Source/Documentation/wiki/Connection_Strings.md#actionadapterbase)

Here are various `ActionAdapter` examples:

> **[gsf/Source/Libraries/Adapters/PowerCalculations at master ·...](https://github.com/GridProtectionAlliance/gsf/tree/master/Source/Libraries/Adapters/PowerCalculations)**
>
> master/Source/Libraries/Adapters/PowerCalculations

Also, here is another good example of an adapter, this happens to be an `InputAdapter`, but the most concepts still apply: [GitHub - GridProtectionAlliance/CSVLimitsLoader: GSF Time-series Library Adapter for Loading EMS Limits from a CSV File](https://github.com/GridProtectionAlliance/CSVLimitsLoader)

Here are some good documentation links:

- [openPDC/Developers\_Custom\_Adapters.md at master · GridProtectionAlliance/openPDC · GitHub](https://github.com/GridProtectionAlliance/openPDC/blob/master/Source/Documentation/wiki/Developers_Custom_Adapters.md)
- [openPDC/Developers\_Two\_Custom\_Adapter\_Examples.md at master · GridProtectionAlliance/openPDC · GitHub](https://github.com/GridProtectionAlliance/openPDC/blob/master/Source/Documentation/wiki/Developers_Two_Custom_Adapter_Examples.md)

---

<div class="post-metadata">

**Author:** ![mrestrepo](http://discussions.gridprotectionalliance.org/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mrestrepo](http://discussions.gridprotectionalliance.org/u/mrestrepo)\
**Post date:** [December 28, 2021, 4:07pm UTC](http://discussions.gridprotectionalliance.org/t/actionadapter-does-not-publish-frames/988/3 "2021-12-28T16:07:04Z")

</div>

Hi Ritchie, thank you for your reply.

I have an ActionAdapter it was made following the steps you sent me, but when i inicialized the Adapter it show me this error:

[Action Adapter Collection] Failed to initialize adapter RAG\_GPA: The given key was not present in the dictionary.

I was looking for this dictionary or the connection string and i did not find, could yo help me plese?

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [December 28, 2021, 8:24pm UTC](http://discussions.gridprotectionalliance.org/t/actionadapter-does-not-publish-frames/988/4 "2021-12-28T20:24:27Z")

</div>

I may not be able to help much without source code, but it sounds like you are missing some connection string parameters, e.g.:

```auto
FramesPerSecond=30; LagTime=5.0; LeadTime=5.0;
InputMeasurementKeys=FILTER TOP 2 ActiveMeasurements WHERE SignalType='VPHA'

```
