Repository navigation
Feature/optimize 04 multidim array shape fix - #14
Merged
jogibear9988 merged 4 commits intoOct 7, 2026
Merged
jogibear9988 merged 4 commits into
jogibear9988 merged 4 commits into
Conversation
…r lists (GML-1187)
Port net functional changes from fork package 01 (DataTypes extension / string array fix, commits 6aef271/519cdeb/ffe8daa): - PlcTag: add virtual GetValue()/SetValue(object) reflecting the concrete tag's public Value property, for generic tag value access. - POffsetInfoType: add virtual MaxStringLength(), returning 0 by default, UnspecifiedOffsetinfo1 for Array1Dim (string array max length), and Min(UnspecifiedOffsetinfo1, UnspecifiedOffsetinfo2) for String (fixes cases where firmware swaps both fields). All other changes from this fork package are already superseded by the target repo's own PlcTag/PlcTags implementation and are documented as excluded in package 16.
…ING/WSTRING writes to fail
…ltidimensional CLR arrays
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Multidimensional catalog restoration and writes remain incorrect, while OpenSSL processing is still concurrently accessible.
Review effort: Balanced
Findings: 3
Open (5)
Multidimensional DTL writes fail from uninitialized companion arrays · New Multidimensional edits are not synchronized before writes · New Queue locks fail to serialize concurrent RunSSL access · New Multidimensional string arrays lose declared element length · New Catalog round-trip loses multidimensional tag shape · New
What changed in this PR
Adds multidimensional array shaping and PLC-declared string-length propagation to tag resolution, caching, and value handling.
Changes:
- Reshapes multidimensional aggregate values for reads and writes.
- Preserves string length metadata in tags and catalogs.
- Adds queue locking to the OpenSSL connector.
| File | Description |
|---|---|
S7CommPlusTagAccessorCatalog.cs |
Persists string lengths. |
S7CommPlusProtocolSession.cs |
Propagates dimensions and string lengths. |
OpenSSLConnector.cs |
Adds pending-list locks. |
POffsetInfoType.cs |
Extracts string lengths. |
PlcTags.cs |
Constructs correctly sized string tags. |
PlcTag.cs |
Implements multidimensional value handling. |
Browser.cs |
Exposes string length metadata. |
PlcTagStringMaxLengthTests.cs |
Tests string sizing. |
PlcTagMultiDimensionalArrayTests.cs |
Tests multidimensional arrays. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+100
to
+104
| if (m_AggregateDimensions.Count > 1 && value is Array multiDimValue) | ||
| { | ||
| DistributeMultiDimensionalValue(multiDimValue); | ||
| AggregateValue = multiDimValue; | ||
| return; |
Comment on lines
+211
to
214
| if (m_AggregateElements.Count == 0 || m_AggregateDimensions.Count > 1) | ||
| { | ||
| return; | ||
| } |
Comment on lines
+36
to
+37
| private readonly object m_readListLock = new object(); | ||
| private readonly object m_writeListLock = new object(); |
Comment on lines
+72
to
+76
| /// <summary> | ||
| /// Gets the maximum string length for a String/WString offset info, or 0 when not applicable. | ||
| /// </summary> | ||
| /// <returns>The maximum length in characters, or 0 for non-string offset info types.</returns> | ||
| public virtual int MaxStringLength() { return 0; } |
Comment on lines
+368
to
+369
| tag.AggregateElements.Select(FromTag).ToArray(), | ||
| tag.GetMaxStringLength()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Contains the sources from branch feature/optimize-03