fix(driver-twincat): resolve Medium code-review finding (Driver.TwinCAT-011)
Confirm AdsErrorCode values from Beckhoff.TwinCAT.Ads 7.0.172 and rewrite MapAdsError with 20 explicit cases. Fix critical bug: AdsSymbolVersionChanged was 0x0702 (DeviceInvalidGroup) but DeviceSymbolVersionInvalid is 1809 (0x0711); correct constant and all comments. Add BadOutOfService for DeviceNotReady and BadInvalidState for DeviceInvalidState/PLC-in-Config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,7 @@ internal sealed class AdsTwinCATClient : ITwinCATClient
|
||||
|
||||
public event EventHandler? OnSymbolVersionChanged;
|
||||
|
||||
/// <summary>Raise <see cref="OnSymbolVersionChanged"/> when <paramref name="adsError"/> is 0x0702.</summary>
|
||||
/// <summary>Raise <see cref="OnSymbolVersionChanged"/> when <paramref name="adsError"/> is <c>DeviceSymbolVersionInvalid</c> (1809 / 0x0711).</summary>
|
||||
private uint MapAndSignal(uint adsError)
|
||||
{
|
||||
if (TwinCATStatusMapper.IsSymbolVersionChanged(adsError))
|
||||
|
||||
Reference in New Issue
Block a user