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

enumeration #107

Open
klementuel opened this issue Mar 15, 2021 · 4 comments
Open

enumeration #107

klementuel opened this issue Mar 15, 2021 · 4 comments

Comments

@klementuel
Copy link

Hello,
I would like to create my own enumeration type, had already tried to copy existing ones, but unfortunately I can't change the NodeId and the whole thing ends in an error.

Do you have a trick how this could be done, or is this still nice to have?

Greetings

@oroulet
Copy link
Member

oroulet commented Mar 15, 2021

using the new API from asyncua it now much easier(and safer) to create models using code. see example https://github.com/FreeOpcUa/opcua-asyncio/blob/master/examples/server-data-type-definition.py

Otherwise make a node and then copy the enum definitoin variable from another node and modify. It should work

@klementuel
Copy link
Author

ok this might be a solution for another project, in this project (this is for a thesis) I would like to use a modeler to better display the modelling. Then use the created NodeSet as a diversion for an open62541 server.

Unfortunately I don't quite understand the copy, when I copy and paste an enum type, I get the error:
opcua.ua.uaerrors._base.UaError: Datatype must be a subtype of builtin types i=20010
because I can't edit the NodeID to push the type into my namespace.

If it doesn't work, that's just the way it is...

@oroulet
Copy link
Member

oroulet commented Mar 15, 2021

I have done that mamy times so it should work. Create a new data type under enums. They only copy the variable describing the values

@klementuel
Copy link
Author

I try it again, but it always only and int32 without enum informations...

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