fix(ablegacy): Test Connect normalises the probe address like the driver (#660)
Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
@@ -98,12 +98,18 @@ public sealed class AbLegacyDriverProbe : IDriverProbe
|
||||
?? FirstProbeableTagAddress(opts, firstDevice)
|
||||
?? "S:0";
|
||||
|
||||
// Normalise through the same helper as the driver's probe loop (#660): PLC-5 octal I/O -> decimal.
|
||||
// An unparseable address is a clean failure here — the factory would otherwise throw outside the try.
|
||||
var normalisedName = AbLegacyProbeAddress.Normalise(tagName, firstDevice?.PlcFamily ?? AbLegacyPlcFamily.Slc500);
|
||||
if (normalisedName is null)
|
||||
return new(false, $"Probe address '{tagName}' is not a valid AbLegacy address for this PLC family.", null);
|
||||
|
||||
var p = new AbLegacyTagCreateParams(
|
||||
Gateway: parsed.Gateway,
|
||||
Port: parsed.Port,
|
||||
CipPath: parsed.CipPath,
|
||||
LibplctagPlcAttribute: profile.LibplctagPlcAttribute,
|
||||
TagName: tagName,
|
||||
TagName: normalisedName,
|
||||
Timeout: timeout);
|
||||
|
||||
var factory = _tagFactory ?? (AbLegacyTransportResolver.Resolve(opts) == AbLegacyTransport.Native
|
||||
|
||||
Reference in New Issue
Block a user