[focas] FOCAS — Bulk PMC range read coalescing #357
Reference in New Issue
Block a user
Delete Branch "auto/focas/F2-d"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Bulk PMC range read coalescing for FOCAS — eliminates one TCP RTT per PMC byte at scale.
Wire/FocasPmcCoalescer.cs(new) —Plan(IEnumerable<PmcAddressRequest>)groups same-letter / same-path requests into contiguous byte ranges. Cap 256 bytes per group with a 16-byte bridge gap (mirrors the Modbus pattern).IFocasClient.ReadPmcRangeAsync(letter, pathId, startByte, byteCount, ct)— new method with a default per-byte fallback so existing transports keep working.FwlibFocasClient— real implementation that chunks 32-byte FWLIB calls under one logical range.FocasDriver.ReadAsync— newPrefetchPmcRangesAsyncpre-pass: build requests → plan groups → issue oneReadPmcRangeAsyncper group → slice buffer back to per-tag results viaDecodePmcSlice(handles Bit/Byte/Int16/Int32/Float32/Float64 + bit-extract forR100.3-style addresses).FakeFocasClientupdated withRangeReadLogand aPmcByteRangesbyte store.Test plan
dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.FOCAS— clean (0 / 0)dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests— 328 / 328 passed (18 new: contiguous 100B → 1 wire call, range cap split 300B → 2 groups, gap bridging vs splitting, different letters/paths splitting, wider-type contiguity, overlapping requests, bit-addressed shared-byte coalescing, mixed PMC+Parameter+Macro batches, ByteWidth helpers)🤖 Auto-generated by the Mode-B execution loop. Closes #266.
Closes #266