namespace ZB.MOM.WW.OtOpcUa.Driver.TwinCAT; /// /// Filter system / infrastructure symbols out of a TwinCAT symbol-loader walk. TC PLC /// runtimes export plumbing symbols alongside user-declared ones — TwinCAT_SystemInfoVarList, /// constants, IO task images, motion-layer internals — that clutter an OPC UA address space /// if exposed. /// public static class TwinCATSystemSymbolFilter { /// true when the symbol path matches a known system / infrastructure prefix. public static bool IsSystemSymbol(string instancePath) { if (string.IsNullOrWhiteSpace(instancePath)) return true; // Runtime-exported info lists. if (instancePath.StartsWith("TwinCAT_SystemInfoVarList", StringComparison.OrdinalIgnoreCase)) return true; if (instancePath.StartsWith("TwinCAT_", StringComparison.OrdinalIgnoreCase)) return true; if (instancePath.StartsWith("Global_Version", StringComparison.OrdinalIgnoreCase)) return true; // Constants pool — read-only, no operator value. if (instancePath.StartsWith("Constants.", StringComparison.OrdinalIgnoreCase)) return true; // Anonymous / compiler-generated. if (instancePath.StartsWith("__", StringComparison.Ordinal)) return true; // Motion / NC internals routinely surfaced by the symbol loader. if (instancePath.StartsWith("Mc_", StringComparison.OrdinalIgnoreCase)) return true; return false; } }