Skip to content

Feature/optimize 04 multidim array shape fix - #14

Merged
jogibear9988 merged 4 commits into
dotnetprojects:masterfrom
Stiwa-PohG:feature/optimize-04-multidim-array-shape-fix
Oct 7, 2026
Merged

jogibear9988 merged 4 commits into
dotnetprojects:masterfrom
Stiwa-PohG:feature/optimize-04-multidim-array-shape-fix

Conversation

@Stiwa-PohG

Copy link
Copy Markdown

Contains the sources from branch feature/optimize-03

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Multidimensional catalog restoration and writes remain incorrect, while OpenSSL processing is still concurrently accessible.

Review effort: Balanced
Findings: 3 High severity · 2 Medium severity

Open (5)
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());
@jogibear9988
jogibear9988 merged commit d1111e4 into dotnetprojects:master Oct 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants