Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot easily instantiate objects/create objects of specified type #310

Open
evanjs opened this issue Jan 10, 2024 · 1 comment
Open

Cannot easily instantiate objects/create objects of specified type #310

evanjs opened this issue Jan 10, 2024 · 1 comment

Comments

@evanjs
Copy link

evanjs commented Jan 10, 2024

Problem

As originally mentioned in #297

I am trying to instantiate nodes (esp. objects) based on other node types.

As mentioned in the linked discussion, I am currently unable to do so using this library.

While I can create e.g. two distinct empty objects named Machine One and Machine Two, when I try to assign them to a type via has_type_definition, not even mandatory properties are created for me.

If I use has_component, the properties are created, but share the same instance across the objects with those components, which is not what I want.

If I understand the behavior of has_component correctly, I figure it is not what I should be using here.
In addition, it sounds like has_type_definition is closer to what I want, but it will not create any properties for me on the new object.


I wanted to verify whether:

  • I am using the library incorrectly

    or

  • The library currently doesn't have an instantiate function.

If I understand correctly, and this library does not currently have an instantiate function, then I would need to populate all properties by hand each time I instantiate an object.


Existing functions in other libraries

Python

python-opcua(DEPRECATED)

instantiate: function, usage

opcua-asyncio (ACTIVE)

instantiate: function, usage


.NET

UA-.NETStandard

CreateInstance


Node

Node-OPCUA

Instantiate: function, usage

@hirschenberger
Copy link

I would also need a recursive create_instance function.

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

No branches or pull requests

2 participants