Cant send messages from backgrounPlugin to multiple ViewItems in the Smart Client.

I am creating a c# plugin. I am talking to a modbus server in the backgroundplugin. I wanna send individual data to 8 ViewItems in the Smart Client. I am having problems sending data with messages to individual ViewItems.

I am getting this error: Same messageId being registered multiple times.

Is it a better way sending data from the background to multiple ViewItems?

If your background plugin is working on Event Server and send a message to Smart Client, you might see warnings. In this case, you can simply ignore the warnings when you send messages. If the plugin is working on Smart Client, you need to use EnvironmentManager.Instance.SendMessage , please see this link - https://doc.developer.milestonesys.com/html/index.html?base=reference/architecture/plug-in_integration.html&tree=tree_search.html?search=environment%20smartclient

In the ViewItemWpfUserControl i have a MessageHandler that listens to a MessageId. When i create multiple objects of the ViewItemWpfUserControl i get this error: Same messageId being registered multiple times.

The message is being sent from the BackgroundPlugin, can i ignore this error?

Or is it different way to do this.

Can i use Events to send/stream data to the Events? And have multiple objects subscribe to this event?

Please confirm that your background plugin working on Event Server and this plugin send messages to Smart Client. You can ignore the warning messages (“Same messageId being registered multiple times”) - they are just there to ensure that people hasn’t accidentally registered multiple times.

If you want to design it differently to avoid this message you could register for the message reception in the plugin-definition (ensure only to do so if plugin is running in client) and then distribute the messages to the user controls yourself (in order to avoid registering for the same message multiple times).

​My background plugin is working on the Event Server. And I am sending a message from this Background plugin, to the ViewItemWpfUserControl plugin that is running in the Smart Client. The MessageId i am using is defined in the PlguinDefinition.

So it seems like I can ignore the warning: “Same messageId being registered multiple times”. Beacause the Smart Client keeps running fine with this error. I was just worried that this warning would create some issues.

Thank you for your confirmation, yes then please ignore the warnings.