Methods define callable functions. Methods are invoked using the Call Service defined in OPC 10000-4. Method invocations are not represented in the AddressSpace. Method invocations always run to completion and always return responses when complete. Methods are defined using the Method NodeClass, specified in Table 15.
Table 15 – Method NodeClass
|Base NodeClass Attributes||M||--||Inherited from the Base NodeClass. See 5.2.|
|Executable||M||Boolean||The Executable Attribute indicates if the Method is currently executable (“False” means not executable, “True” means executable).
The Executable Attribute does not take any user access rights into account, i.e. although the Method is executable this may be restricted to a certain user / user group.
|UserExecutable||M||Boolean||The UserExecutable Attribute indicates if the Method is currently executable taking user access rights into account (“False” means not executable, “True” means executable).|
|HasProperty||0..*||HasProperty References identify the Properties for the Method.|
|HasModellingRule||0..1||Methods can point to at most one ModellingRule Object using a HasModellingRule Reference (see 6.4.4 for details on ModellingRules).|
|GeneratesEvent||0..*||GeneratesEvent References identify the type of Events that will be generated whenever the Method is called.|
|AlwaysGeneratesEvent||0..*||AlwaysGeneratesEvent References identify the type of Events that shall be generated whenever the Method is called.|
|<other References>||0..*||Methods may contain other References.|
|NodeVersion||O||String||The NodeVersion Property is used to indicate the version of a Node.
The NodeVersion Property is updated each time a Reference is added or deleted to the Node the Property belongs to. Attribute value changes do not cause the NodeVersion to change. Clients may read the NodeVersion Property or subscribe to it to determine when the structure of a Node has changed.
|InputArguments||O||Argument||The InputArguments Property is used to specify the arguments that shall be used by a client when calling the Method.|
|OutputArguments||O||Argument||The OutputArguments Property specifies the result returned from the Method call.|
The Method NodeClass inherits the base Attributes from the Base NodeClass defined in 5.2. The Method NodeClass defines no additional Attributes.
The Executable Attribute indicates whether the Method is executable, not taking user access rights into account. If the OPC UA Server cannot get the Executable information from the underlying system, it should state that it is executable. If a Method is called then the Server should transfer this request and return the corresponding StatusCode even if such a request is rejected. StatusCodes are defined in OPC 10000-4.
The UserExecutable Attribute indicates whether the Method is executable, taking user access rights into account. If the OPC UA Server cannot get any user rights related information from the underlying system, it should use the same value as used in the Executable Attribute. The UserExecutable Attribute can be set to “False”, even if the Executable Attribute is set to “True”, but it shall be set to “False” if the Executable Attribute is set to “False”. Clients cannot assume a Method can be executed based on the UserExecutable Attribute. It is possible that the Server may return an access denied error due to some Server specific change which was not reflected in the state of this Attribute at the time the Client accessed it.
Properties may be defined for Methods using HasProperty References. The Properties InputArguments and OutputArguments specify the input arguments and output arguments of the Method. Both contain an array of the DataType Argument as specified in 8.6. An empty array or a Property that is not provided indicates that there are no input arguments or output arguments for the Method.
The Property NodeVersion indicates the version of the Method. There are no additional Properties defined for Methods in this document. Additional parts of this series of standards may define additional Properties for Methods.
To specify its ModellingRule, a Method can use at most one HasModellingRule Reference pointing to a ModellingRule Object. ModellingRules are defined in 6.4.4.
GeneratesEvent References identify that Methods may generate an Event of the specified EventType or one of its subtypes for every call of the Method. A Server may generate one Event for each referenced EventType when a Method is successfully called.
AlwaysGeneratesEvent References identify that Methods will generate an Event of the specified EventType or one of its subtypes for every call of the Method. A Server shall always generate one Event for each referenced EventType when a Method is successfully called.
Servers should make GeneratesEvent References bidirectional References. However, it is allowed to be unidirectional when the Server is not able to expose the inverse direction pointing from the EventType to each Method generating the EventType.
GeneratesEvent References are optional, i.e. the call of a Method may produce Events of an EventType that is not referenced with a GeneratesEvent Reference by the Method.
Methods may use additional References to define relationships to other Nodes. No restrictions are placed on the types of References used or on the NodeClasses of the Nodes that may be referenced. However, restrictions may be defined by the ReferenceType excluding its use for Methods. Standard ReferenceTypes are described in Clause 7.
A Method shall always be the TargetNode of at least one HasComponent Reference. The SourceNode of these HasComponent References shall be an Object or an ObjectType. If a Method is called then the NodeId of one of those Nodes shall be put into the Call Service defined in OPC 10000-4 as parameter to detect the context of the Method operation.
If the Method is used as InstanceDeclaration (see 4.5) all Nodes referenced with forward hierarchical References shall have unique BrowseNames in the context of this Method.