Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Proposed changes

Adds documentation for Opc.Ua.Client.ComplexTypes library to address the complete lack of documentation and examples for working with custom structures and enumerations in OPC UA.

Created Docs/ComplexTypes.md (660 lines) covering:

  • Core concepts: Type discovery, loading mechanisms (DataTypeDefinition, binary/XML dictionaries), dynamic .NET type generation
  • Basic operations: Loading types, reading/writing complex values, property access patterns
  • Advanced usage: Namespace-specific loading, type introspection, custom factories, telemetry integration
  • Patterns: One-time loading, lazy loading, batch operations
  • API reference: Complete signatures for ComplexTypeSystem, IComplexTypeProperties, ComplexTypePropertyInfo
  • Troubleshooting: Common issues (types not loading, ExtensionObject encoding, performance)

Example workflow:

// Load custom types
var complexTypeSystem = new ComplexTypeSystem(session);
await complexTypeSystem.LoadAsync();

// Read structured data
DataValue dataValue = await session.ReadValueAsync(nodeId);
var complexType = (IComplexTypeProperties)((ExtensionObject)dataValue.Value).Body;

// Access properties by name or index
complexType["Temperature"] = 25.5;
complexType["Pressure"] = 101.3;

// Write back
await session.WriteAsync(null, writeValues, CancellationToken.None);

Updated Docs/README.md: Added ComplexTypes reference, fixed inconsistent ECC Certificates path.

Related Issues

Types of changes

  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

Documentation follows existing structure (similar to PubSub.md, Observability.md). All API signatures verified against implementation. No code changes required.

Original prompt

This section details on the original issue you should resolve

<issue_title>ComplexType - Lack of Documentation</issue_title>
<issue_description>### Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

Documentation, Examples, etc... are inexistent regarding ComplexType

Expected Behavior

Documentation, simple examples exists for the ComplexType usage.

I want to be able do Write and Read Structs from a Client to a Server in a one shot way.
I'm unable to figure out the way to do this.

Steps To Reproduce

No response

Environment

No response

Anything else?

No response</issue_description>

<agent_instructions>Please add a documentation file describing how to use the Opc.Ua.Client.ComplexTypes packages and what functionality it provided</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@mregen Hi @deinok, complex type bug fixes and updates are planned for the next release.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI and others added 2 commits December 3, 2025 05:50
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for ComplexType usage Add comprehensive documentation for ComplexTypes library Dec 3, 2025
Copilot AI requested a review from romanett December 3, 2025 05:58
@marcschier marcschier marked this pull request as ready for review December 3, 2025 16:25
@marcschier marcschier merged commit 35e03d9 into master Dec 3, 2025
81 of 83 checks passed
@romanett romanett deleted the copilot/add-documentation-for-complextype branch December 3, 2025 20:13
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.

ComplexType - Lack of Documentation

4 participants