[s7] S7 — Array tags (ValueRank=1) #339
Reference in New Issue
Block a user
Delete Branch "auto/s7/PR-S7-A4"
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
S7 1-D array tags (ValueRank=1) for fixed-width element types.
S7TagDefinition.cs— new optionalElementCountproperty. When>1, the tag is a 1-D array of the configuredS7DataType.S7Driver.cs—ReadOneAsync/WriteOneAsyncissue a singleReadBytesAsync/WriteBytesAsynccoveringN × elementBytes, then slice / pack client-side via the existing big-endian scalar codecs andS7DateTimeCodec.DiscoverAsyncflowsIsArray=true+ArrayDim=[ElementCount]so the address-space builder picks ValueRank=1.ElementCountat 8000 (realistic S7 PDU limit) and rejects unsupported element types (STRING/WSTRING/CHAR/WCHAR + BOOL) with aFormatException.Supported element types: Byte, Int16/UInt16, Int32/UInt32, Int64/UInt64, Float32, Float64, Date, Time, TimeOfDay.
Deferred (per issue body):
Test plan
dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.S7— clean (0 / 0)dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.S7.Tests— 123 / 123 passed (8 new inS7DriverArrayTests: Int16/Int32/Float32/Float64 round-trip, big-endian layout sanity, init-time rejection of String/Bool element types and oversized ElementCount)🤖 Auto-generated by the Mode-B execution loop. Closes #290.
Closes #290