-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Create optional event fields on the fly, if user tries to set them #2736
Comments
An Event is created by instantiating a specific event type. If you need to set optional child nodes, i.e., event fields, then currently the only way is to create a custom event subtype, which overwrites the modelling rule from optional to mandatory. We may need to find a better way in the future to easily allow overriding a modelling rule for type instances. Not only for events, but also especially for objects. |
Hey @Pro,
|
Thank you very much for your answers. |
Perfect! I changed the tile of the issue and marked it as a feature request. To summarize: We need a method in the helper API which performs the steps as suggested by @jpfr:
Starting point is here:
E.g., we need a method |
We could just make it the default behaviour. |
Hello!
I am currently experimenting with Pro's euromap test branch:
https://github.com/Pro/open62541/tree/test/euromap/examples/nodeset/euromap
I can successfuly build and run the server_nodeset_euromap project on Windows.
cmake .. -DUA_NAMESPACE_ZERO=FULL -DUA_ENABLE_AMALGAMATION=NO -DUA_BUILD_EXAMPLES=YES -G "Visual Studio 15 2017"
Then I tried to fire some Euromap events (e.g. CycleParametersEventType).
The event fields with mandatory modelling rule work as expected. I can see the event field values in UaExpert and WireShark. But optional fields do not work.
When I setup the event fields the function UA_Server_writeObjectProperty_scalar returns with BadNoMatch statuscode for optional event fields.
I don't think that I have accidently used a wrong qualified name for all optional fields. The event fields are all in the same type hierarchy (under CycleParametersEventType) and have the same namespace and mandatory fields work as expected.
I didn't change anything on the branch, except for following server_nodeset_euromap.c file. The code is adapted from server events tutorial.
server_nodeset_euromap.txt
I think that the optional event fields are not generated from the nodeset compiler. But I can't find any differences in namespace_euromap83_generated.c and namespace_euromap77_generated.c between mandatory fields like "CurrentLotName" and optional fields like "AverageCycleTime" of event type CycleParametersEventType. Except for the modelling rule reference.
Do I have to enable the generation of optional fields?
Or do I have to create a subtype of the eventtype, which overwrites all optional fields to mandatory?
Thanks for your support!
The text was updated successfully, but these errors were encountered: