05/04/2022
Basic question - is it possible to discover (by browsing type information at runtime) which events are generated by a given object?
To cite a specific example, the OPC Reference Server has an object at Root -> Objects -> Boilers -> Boiler #2 with attribute "EventNotifier = SubscribeToEvents". Sure enough, instance Boiler #2 has a "HasEventSource" reference of "Simulation", which is an object of type "BoilerStateMachineType".
I can use UA Expert to subscribe to events on Boiler #2, and indeed see ProgramTransitionEventType events triggered when I cause state transitions by Call'ing the Simulation object's Halt, Reset, Resume, Start, and Suspend methods.
Certainly, the ProgramTransitionEventType is enumerated by the server's EventTypes folder object. However, when inspecting BoilerStateMachineType and supertypes, I don't see any indication of the types of events that can be fired.
Is it possible to discover / enumerate event types that can be fired by a given Object, or is this something that has to be "known" ahead of time?
05/30/2017
It is recommended that objects/methods that produce events use the GeneratesEvents/AlwaysGeneratesEvents non-hierarchical reference to indicate what events are produced. (see https://reference.opcfoundatio.....ocs/7#7.15). However, there are a few caveats:
1) It is recommendation, not a requirement;
2) The reference will be in the TypeDefinition and not on the instances.
3) The reference may be on a child of the TypeDefinition, such as a Method, rather than on the TypeDefinition itself.
1 Guest(s)