Be sure to check if the following works for you:
myTcAdsClient.Synchronize = false
Do this immediately after initializing the TcAdsClient instance. Setting Synchronize to true makes sense in GUI-based applications that are heavily dependent on the main thread.
In my current project, I created a wrapper class around TcAdsClient to be able to use it in a Windows service that starts and stops the TwinCat environment, but the wrapper device class places the AdsClient in a separate thread (in an endless run ()).
To notify me of a change in terms of TwinCat variables, my wrapper class offers its own event that the Windows service connects to; it starts whenever the TwinCat base client AdsNotificationExEventHandler starts inside the device shell class. When I tested this setting in a WindowsForms application, everything worked fine. But not in the console application, nor in my Windows service - AdsNotificationExEventHandler never started. The key is a thread synchronization function for TcAdsClient - by default, an attempt is made to synchronize all notifications in the main thread, which was not the right choice for my setup. It seems the same is true for you.
source share