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

Unable to Load Adaptor that Calculates Average Frequency

Apr 21, 2011 at 6:30 PM

I am trying to setup CalculatedMeasurements for PowerCalculations.AverageFrequency. I keep getting this error:

[Action Adapter Collection] Failed to load adapter "AVG_FREQ" [PowerCalculations
.AverageFrequency] from "c:\program files\openpdc\PowerCalculations.dll": An ite
m with the same key has already been added.

Why do I get this and how do I get past this message and get the adapter to load? 

Apr 25, 2011 at 8:41 PM

What is your inputMeasurementKeys filter definition / point list?

Looks like a duplicate value is being received.


Apr 26, 2011 at 3:11 PM

This is what I have in my Calculated Measurement Definition:



Assembly Name: PowerCalculations.dll

Type Name: PowerCalculations.AverageFrequency

Connection String: framesPerSecond=30;lagTime=3;leadTime=1; inputMeasurementKeys={FILTER ActiveMeasurements WHERE SignalType = 'FREQ'}; outputMeasurements={PPA:1031; PPA:1032; PPA:1035;}

Apr 29, 2011 at 8:44 PM

You don't have two adapters called AVG_FREQ I assume?

I setup the calculator successfully in test mode on my local system using the following settings added to the "CalculatedMeasurement" table:

Acronym Name AssemblyName TypeName InputMeasurementKeys OutputMeasurements
AVGFREQ Average Frequency Calculation PowerCalculations.dll PowerCalculations.AverageFrequency FILTER ActiveMeasurements WHERE SignalType='FREQ' P1:1885;P1:3596;P1:3597


Apr 29, 2011 at 8:53 PM

I have only one Calculated Measurement called "AVG_FREQ". I do have other custom action adapters in customactionadapters table. Do they affect the way Calculated Measurement adapters get loaded? When the error says "An item with the same key has already been added." what is the "Key" here? Is it the Acronym or the ID or any other field? Thanks

Apr 29, 2011 at 9:42 PM

They shouldn't - I haven't seen that error. How old is your code set? We did fix an error recently (well, about a month ago) where the key-value pair connection string parser threw a similar exception when it encountered duplicate keys:

The exception you are receiving is from a dictionary, in a cursory look through the boot-strap code I don't see any where else this could occur save parsing the connection string to load the Settings dictionary.

You might check your connection string for the AVG_FREQ to see if it contains a duplicate key. An easy way to do this is go to the Adapters / View Iaon Tree screen in the openPDC Manager then hold your mouse over the adapter - the tool tip will show the connection string.

Alternately simply open the view called IaonActionAdapter and the look at the connection string for the AVG_FREQ adapter, or open the cached SystemConfiguration.xml for the same.


May 2, 2011 at 9:28 PM

Thanks Ritchie! I upgraded to the latest SP and I seem to not get the error. I also see the calculated measurement values show up in openPDC Manager.