...
else if (readLength >= symbol.GetValueMarshalSize())
{
byte[] array3 = new byte[symbol.GetValueMarshalSize()];
AdsErrorCode errorCode2 = OnWriteRawValue(symbol, array3.AsSpan());
result = ((!errorCode2.Succeeded()) ? ResultReadWriteBytes.CreateError(errorCode2, invokeId) : ResultReadWriteBytes.CreateSuccess(array3, invokeId));
}
...
Please check and fix the AdsSymbolicServer implementation.
Side note:
i found many other (probably minor?) glitches and issues with your .NET libraries. (i.e. wrong/inconsistent calculations in padding and packing of user defined marshaled data structures). I was able to workaround many of this issues, with the help of various decompilers... but if the source code of the libraries had been available it would have been easier to find and fix issues... Why don't you consider to open the source and share it on github???? You may also receive a lot of PR to fix and improve your product!!!!
I'm facing strange problems testing with AdsSymbolicServer (from
<PackageReference Include="Beckhoff.TwinCAT.Ads.SymbolicServer" Version="6.0.216" />
). I tried to activate immediate notifications changing line https://github.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/blob/2325825ba7ad3f55e6c5b9273b9bf88be9d8b76d/Sources/ServerSamples/AdsSymbolicServerSample/Program.cs#L208 in the provided sample with this:IDisposable subscription = SubscribeNotifications(session, symbols, NotificationSettings.ImmediatelyOnChange);
and i got strange unexpected behaviours.So i did some debugging and i realized that the function https://github.com/Beckhoff/TF6000_ADS_DOTNET_V5_Samples/blob/2325825ba7ad3f55e6c5b9273b9bf88be9d8b76d/Sources/ServerSamples/AdsSymbolicServerSample/AdsSymbolicServer.cs#L383-L390 was unexpectedly called during the notification process... Digging into details with the help of decompiled code of the library
Beckhoff.TwinCAT.Ads.SymbolicServer
i found 3 point whereOnWriteRawValue
is obviously called by error instead ofOnReadRawValue
(they both have compatible signatures so the compiler doesn't catch this!)into
FireNotificationAsync
function:into
createNotificationInformation
function:into
OnReadWriteValueByNameAsync
function:Please check and fix the
AdsSymbolicServer
implementation.Side note: i found many other (probably minor?) glitches and issues with your .NET libraries. (i.e. wrong/inconsistent calculations in padding and packing of user defined marshaled data structures). I was able to workaround many of this issues, with the help of various decompilers... but if the source code of the libraries had been available it would have been easier to find and fix issues... Why don't you consider to open the source and share it on github???? You may also receive a lot of PR to fix and improve your product!!!!