Tags: dotnetprojects/S7CommPlusDriver
Tags
feat: add TIS trace subscription support Expose the PLC online-capabilities blob so callers can select supported TIS behavior without relying on model or firmware assumptions. Add trace request, notification, and subscription types together with asynchronous client lifecycle management, timeout handling, event publication, and deterministic remote cleanup. Support both continuing and trace job classes, including request, trigger, interpretation, client-data, and large-buffer attributes, subscription references, notification credits, and result-buffer reads. Preserve detailed PLC rejection information in lifecycle diagnostics and remove partially created trace jobs when validation fails.
Reduce retained memory for large tag catalogs Large MCC installations may resolve up to 1.5 million PLC tags across dozens of connections. The previous accessor representation retained a List<uint> and backing storage for every ItemAddress, duplicated root symbol strings, and kept dictionary-heavy alarm text structures. These fixed per-tag costs become significant even though the protocol only needs a small immutable address and datatype descriptor after browsing. Store up to four local IDs inline in ItemAddress and lazily materialize the legacy LID list only when callers request it. Update protocol, snapshot, subscription, and catalog code to use the compact representation directly. Materialized tags now reuse the requested symbol for both the dictionary key and PlcTag.Name, and catalog creation can return an owned dictionary without another full copy. Introduce accessor-cache format version 2, while retaining version 1 read compatibility. Version 2 omits the duplicated root tag name and writes entries in existing dictionary order, avoiding a full-catalog sort and reducing cache size and startup allocation pressure. Represent text-list entries as readonly structs in one owned array, replace tuple catalog keys with packed integer keys, remove per-list exact-value dictionaries, and decode directly into final arrays. Reuse decoded text strings for identical PLC string-table offsets within one library load without using the process-wide string intern pool. Reduce cyclic allocation churn by making batch result items readonly structs, retaining caller-provided read-only lists, avoiding scalar aggregate expansion lists, and building protocol batches with indexed loops instead of Chunk, Select, and temporary arrays. Add coverage for legacy LID mutation, exact-versus-range text resolution, repeated string offsets, shared symbol/name references, and version 1 cache compatibility. The net8 test suite passes all 170 tests and the driver also builds successfully for net48. Compatibility note: ItemAddress.LID changes from a public field to a property, and result and text-entry reference types become value types. Source consumers remain compatible for normal usage but binaries must be rebuilt together with this driver version.
KCC-583: Implement new S7CommDriver -> make transport cleanup idempotent The release-only net48 test failure exposed a finalizer race: Disconnect closed the active transport but retained its reference, so early finalization or repeated cleanup could close the same transport twice. .NET Framework can consider the client unreachable immediately after its last call, which made the failure intermittent. Detach the transport atomically during disconnect, make Dispose perform complete connection cleanup and suppress finalization, and use stable transport snapshots in send and receive paths so concurrent cleanup cannot introduce a null-reference race. Strengthen the transport lifecycle test to cover repeated disconnect and disposal. Validated with 30 repeated Release/net48 lifecycle-test runs and the complete 160-test suite on net48 and net8.0.
KCC-583: Implement new S7CommDriver -> avoid alarm relation ID collis… …ions Alarm reference relation IDs are global within a PLC. Reusing the same fixed ID for every client caused CreateAlarmSubscription to be rejected when another HMI alarm subscription already owned that relation, even though connections, alarm browsing, languages, and PLC subscription resources were otherwise healthy. Request PLC-side allocation for each alarm-reference relation, matching the existing TIS object-creation pattern, and remove the obsolete fixed-ID constant. Add a protocol request-shape regression test so alarm subscriptions cannot silently return to client-local fixed relation IDs. Validated the corrected request against both affected S7-1500 PLC variants and ran all 160 driver tests on net8.0 and net48.
Add .NET Framework 4.8 support Target the driver for net48 alongside net6.0, net8.0, and net9.0. Enable Harpo-backed legacy challenge authentication on net48 and update HarpoS7 and HarpoS7.PublicKeys to 1.1.4 while keeping net6.0 TLS-only. Add centralized downlevel compatibility for cryptographic helpers, task timeouts and cancellation, monotonic timing, hex conversion, string operations, collection batching, random RID generation, Unix timestamps, and older BCL limitations. Use BouncyCastle as the supported net48 TLS backend and fail fast when native OpenSSL is requested. Dual-target the complete test suite for net8.0 and net48, adapting test utilities without reducing coverage. Update package and user documentation for the new target and security behavior. Add .NET 8 and Windows .NET Framework 4.8 test coverage to push, pull-request, and release workflows, and gate NuGet publishing on the net48 test job. Validated with .NET SDK 9.0.304: all driver targets and applications build with zero warnings; 159 tests pass on net8.0 and 159 pass on net48; the generated NuGet contains lib/net48/S7CommPlusDriver.dll with HarpoS7 1.1.4 and HarpoS7.PublicKeys 1.1.4 dependencies.
KCC-583: Implement new S7CommDriver -> support per-operation request … …timeouts Large symbol-catalog requests could still fail at the shorter RequestTimeout even though GetTagsBySymbols used a longer BrowseTimeout, because only the client-side task deadline changed while protocol and socket waits retained the session default. Apply each operation's effective timeout to the serialized protocol session and live transport before executing it, including reconnect retries and subscription creation requests, then restore the configured request timeout. Browse APIs therefore use BrowseTimeout consistently at every layer without requiring a second PLC connection. Add ExecuteWithTimeoutAsync overloads for result and non-result operations so callers can assign an isolated deadline to any individual request. Async-local timeout scopes keep concurrent callers independent while connect, disconnect, and notification waits retain their specialized settings. Cover browse timeout propagation, restoration, custom result and non-result requests, and concurrent timeout scopes; document the API and large-catalog behavior.
PreviousNext