Use the search and browse feature to view Kepware's repository of more than 500 Knowledge Base articles. Narrow your results or type your query into the search field below.

Search Solutions Results By: View All Solutions

Kepware Knowledge Base: Solution


ClientAce Application Is Getting Multiple DataChanged Events For Each Item


Last Update: 11/12/2018
Problem:
A client application is designed to connect to a server once an hour get data changes before disconnecting. On the first connection, the application gets one DataChanged Event for all of the monitored items. On the next connection, the application gets two DataChanged Events for the monitored items. Each successive connection increases the number of DataChanged Events received for the monitored items. Even though the ClientAce application is creating a new unique connection on every cycle, the application is also creating a new event handler on every cycle. Because that event handler is not part of the server object, it is not destroyed when the application disconnects from the server. This means that the previous event handler still exists on each new connection.

Solution:
Only initialize the event handlers once on application start-up.
Related Products
ClientAce