-
Notifications
You must be signed in to change notification settings - Fork 366
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
Add event support for nested objects (NodeClass.Object) #905
Comments
Thanks for making the change. A side note is we're calling For example, I was subscribed to 1 event which contained about 400 nodes and that took 10 minutes to load. In cases like https://github.com/sightmachine/opcua-asyncio/blob/master/asyncua/common/node.py#L414-L425, we already have the browse name available and passing that into Node ahead of time, the time cut in half. |
There are a lot room of optimization in this code, but you are correct we have the browse_names already. I can look into using the low level api and speed up the code. For your use case you could execute the code once and pickle the EventFilter that is created and reuse it for the next time. I don't know if a event with 400 nodes something that you want to have. Sounds like something that should't be an event. |
🤔 Not sure. From a data perspective, 400 data points doesn't seem like that much in the large scope of a manufacturing plant. Whether doing that setup with an event actually makes sense, that would be something I'd have to ask our customer about. (I have no eyes into what happens with the setup on the server side) |
It's definitely overkill for us right now because I setup application-side filtering after fetching the default |
filter = get_filter_from_event_type([NodeOfTheEvent])
# pickle filter
sub.subscribe_events(... evfilter=filter)
Then create your own filter (Example is for AlarmConditionEvents): content_filter = ContentFilter(
[
ContentFilterElement(
FilterOperator.OfType,
[LiteralOperand(Variant(NodeId(ObjectIds.AlarmConditionType)))],
)
]
)
filter = EventFilter(
[
SimpleAttributeOperand(
BrowsePath=[QualifiedName("EventType")],
AttributeId=AttributeIds.Value,
TypeDefinitionId=NodeId(ObjectIds.BaseEventType),
),
SimpleAttributeOperand(
BrowsePath=[QualifiedName("Message")],
AttributeId=AttributeIds.Value,
TypeDefinitionId=NodeId(ObjectIds.BaseEventType),
),
SimpleAttributeOperand(
BrowsePath=[QualifiedName("ActiveState"), QualifiedName("Id")],
AttributeId=AttributeIds.Value,
TypeDefinitionId=NodeId(ObjectIds.BaseEventType),
),
SimpleAttributeOperand(
BrowsePath=[QualifiedName("ConditionName")],
AttributeId=AttributeIds.Value,
TypeDefinitionId=NodeId(ObjectIds.BaseEventType),
),
],
WhereClause=content_filter,
) |
See: #919 for improved version |
I see that in #415 we added support for variables with properties but it looks like we're still missing
NodeClass.Object
in that filter. These can then contain their own properties, variables, or nested objects.The text was updated successfully, but these errors were encountered: