Hello GPA Team,
I have been using a C# external application, generated through the openECA Client, to receive a set of measurements from the openECA software.
In one instance, we attempted to generate a project with over 150 mapped measurements using the openECA Client. However, the client was unable to complete the project generation. To work around this, we modified an existing project by manually adding new measurements, reaching a total of 174 measurements.
When running the application with these 174 measurements, we encountered the following exception:
“Exception in consumer handler for NewMeasurements event: An item with the same key has already been added.”
Could you please assist us in understanding what might be causing this exception? Is there a way to resolve this issue and prevent it from happening again?
Thank you for your support.
This sounds like there is a duplicate tag being published out the data set.
Are you able to share a portion of your code around the issue you are experiencing?
Thanks,
Ritchie
Hello Ritchie,
Thank you for your response!
The project we are working on is being automatically generated by the openECA Client web service.
In the Algorithm class, we suppressed the default code used for printing the message “Hello World” in the output window, leaving the region reserved for user programming empty.
Additionally, to increase the number of mapped signals beyond the initial configuration, we added new measurements after project generation, as the openECA Client was unable to generate the project with input measurement sets exceeding 150 signals. Hence, we made the following modifications:
-
New measurements were manually added to the input definition classes using the standard syntax.
-
The Mapper class was adjusted to accommodate the new measurements for both Values and MetaValues.
-
The UserDefinedMappings and UserDefinedTypes files were updated post-project generation to reflect the added measurements in the relevant classes.
No additional code is running beyond these modifications and we have thoroughly reviewed the setup and could not identify any duplicates in the measurement definitions.
For context, we mapped 172 signals, and the error message appeared. However, when reducing the number of mapped signals to 160, the error message disappeared. For your reference, consider the screenshots of the output window for both cases attached below.
Another piece of information that could be relevant to your analysis is that we are using input measurements defined as non-Array types.
Please let us know if further details are needed or if additional checks should be performed.
Best regards,
Lucas Zanella & Team