Closed jonev-akva closed 8 months ago
Full project and unit test to reproduce this can be found at this repository.
Thx for sending the UnitTest Code and sorry about the long response time. But we are quite busy here to release TwinCAT 4026 at the moment ... With your Tests, the problem returning "NoError" instead of "TargetPortNotFound" error could be located and fixed easily. See the upcoming (hopefully a few hours) next version 6.1.197 or 6.0.356.
In addition, I can see a further problem causing problems that comes from the AdsClient configuration in your UnitTest Example. TargetPortNotFound is what we call a 'tripping error' that indicates communication problems to an ADS Server. The AdsClient has a mechanism that detects these errors and limits communication to targets indicating these sort of errors for client application robustness by default - what means, that the AdsClient blocks communication (with always the same error) for the next 21 Seconds. You have to switch this feature of, if you want to proceed immediatly in your UnitTests (see also https://infosys.beckhoff.com/content/1033/tc3_ads.net/9407915787.html?id=7609512520970210). You should initialize your AdsClient with switched of FailFastHandler and a higher timeout like this:
using var adsClient = new AdsClient(null,AdsClientSettings.FastWriteThrough, adsClientLogger);
adsClient.Timeout = 60000;
to remove the not wanted side-effects.
Hi @RalfHeitmann, thank you, the new version and the settings you recommends fixed our problem! I can see from the release notes on version 6.1.197 that dependencies are replaced with .NET 8 versions. But from the requirements in the readme it does not look like you are supporting .NET 8 yet? Due to upcoming end of support on .NET 6 (LTS - May 2024) we would like bump our project to .NET 8, do you have any plan to official support this version soon?
We simply missed to update the Readmes (we support .NET 8!) .NET7 is out-of-support soon (on the Microsoft side, not .NET 6 as you have stated) and so in the ADS 6.1.XX versions we replaced the Dependency from .NET7 to .NET 8. For users of the Packages, this shouldn't change something significantly. The new and the old packages are functionally equal, it doesn't matter which .NET Framework you are using. Even in case you are still using .NET7 in your application, the package Version 6.1.197 dependency will fall back to the .NET 6 version - instead of using .NET 7 dependency packages in older variants - and with no changes of functionality or behaviour. I don't see any issue here.
Hi, I am using the AmsTcpIpRouter, AdsServer and AdsClient in my project and i am experiencing some strange behavior. I have created an xunit project to reproduce the behavior;
This is my csproj;
A minimal implementation of the AdsServer;
And the code reproducing the behavior;
The code executes the following scenario
In most executions the last sending returns "NoError" but in some it returns "TargetPortNotFound" and failed. I guess "TargetPortNotFound" is correct? Or should it return "NoError"?
Any help is appreciated.