Replies: 1 comment 3 replies
-
you need to modify your server! myobj = await server.nodes.objects.add_object(idx, "MyObject")
custom_etype = await server.nodes.base_event_type.add_object_type(2, 'MySecondEvent')
await custom_etype.add_property(2, 'MyIntProperty', ua.Variant(0, ua.VariantType.Int32))
await custom_etype.add_property(2, 'MyBoolProperty', ua.Variant(True, ua.VariantType.Boolean))
mysecondevgen = await server.get_event_generator(custom_etype, myobj) create an own eventtype with added custom properties (like a copy of your objecttype with only properies and variables) and if you set the props and vars you can emit the event containing the data you are looking for ;) as a reference look into the opcua types and you will see that many eventtypes are copies from objecttypes |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I would like to access some variables that are defined under an object. But the object is under an event.
Example server:
Example client:
Without the filter, I only get the property directly below the event (MyIntProperty), but I want the object (MyEventObject) and its variable (MyEventVariable).
Of course the server could be wrong, I'm mostly interested in the client side and simulate the server.
I'm new to OPC UA, so my understanding could also be wrong.
Can someone show me an example of how to get an object and its variables / properties below an event?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions