Methodsdefine callable functions. Methodsare invoked using the Call Servicedefined in OPC 10000-4. Method invocations are not represented in the AddressSpace. Method invocations always run to completion and always return responses when complete. Methodsare defined using the Method NodeClass, specified in Table 15.

Table 15– Method NodeClass

Name

Use

Data Type

Description

Attributes

Base NodeClass Attributes

M

--

Inherited from the Base NodeClass. See 5.2.

Executable

M

Boolean

The Executable Attributeindicates if the Methodis currently executable (FALSE means not executable, TRUE means executable).

The Executable Attributedoes not take any user access rights into account, i.e. although the Methodis executable this may be restricted to a certain user / user group.

UserExecutable

M

Boolean

The UserExecutable Attributeindicates if the Methodis currently executable taking user access rights into account (FALSE means not executable, TRUE means executable).

References

HasProperty

0..*

HasProperty Referencesidentify the Propertiesfor the Method.

HasModellingRule

0..1

Methodscan point to at most one ModellingRule Objectusing a HasModellingRule Reference(see 6.4.4for details on ModellingRules).

GeneratesEvent

0..*

GeneratesEvent Referencesidentify the type of Eventsthat may be generated whenever the Methodis called.

AlwaysGeneratesEvent

0..*

AlwaysGeneratesEvent Referencesidentify the type of Eventsthat shall be generated whenever the Methodis called.

HasArgumentDescription

0..*

The HasArgumentDescription Referencesare used to specify argument metadata. If the SourceNodeof this Referenceis defined on an InstanceDeclarationthe TargetNodeshall use the Mandatory ModellingRule.

<other References>

0..*

Methodsmay contain other References.

Standard Properties

NodeVersion

O

String

The NodeVersion Propertyis used to indicate the version of a Node.

The NodeVersion Propertyis updated each time a Referenceis added or deleted to the Nodethe Propertybelongs to. Attributevalue changes do not cause the NodeVersionto change. Clientsmay read the NodeVersion Propertyor subscribe to it to determine when the structure of a Nodehas 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 Methodcall.

The Method NodeClassinherits the base Attributesfrom the Base NodeClassdefined in 5.2. The Method NodeClassdefines no additional Attributes.

The Executable Attributeindicates whether the Methodis executable, not taking user access rights into account. If the OPC UA Servercannot get the Executableinformation from the underlying system, it should state that it is executable. If a Methodis called then the Servershould transfer this request and return the corresponding StatusCodeeven if such a request is rejected. StatusCodesare defined in OPC 10000-4.

The UserExecutable Attributeindicates whether the Methodis executable, taking user access rights into account. If the OPC UA Servercannot get any user rights related information from the underlying system, it should use the same value as used in the Executable Attribute. The UserExecutable Attributecan be set to FALSE, even if the Executable Attributeis set to TRUE, but it shall be set to FALSE if the Executable Attributeis set to FALSE. Clientscannot assume a Methodcan be executed based on the UserExecutable Attribute. It is possible that the Servermay return an access denied error due to some Serverspecific change which was not reflected in the state of this Attributeat the time the Clientaccessed it.

Propertiesmay be defined for Methodsusing HasProperty References. The Properties InputArgumentsand OutputArgumentsspecify the input arguments and output arguments of the Method. Both contain an array of the DataType Argumentas specified in 8.6. An empty array or a Propertythat is not provided indicates that there are no input arguments or output arguments for the Method.

The Property NodeVersionindicates the version of the Method. There are no additional Propertiesdefined for Methodsin this document. Additional parts of this series of standards may define additional Propertiesfor Methods.

To specify its ModellingRule, a Methodcan use at most one HasModellingRule Referencepointing to a ModellingRule Object. ModellingRulesare defined in 6.4.4.

GeneratesEvent Referencesidentify that Methodsmay generate an Eventof the specified EventTypeor one of its subtypes for every call of the Method. A Servermay generate one Eventfor each referenced EventTypewhen a Methodis successfully called.

AlwaysGeneratesEvent Referencesidentify that Methodswill generate an Eventof the specified EventTypeor one of its subtypes for every call of the Method. A Servershall always generate one Eventfor each referenced EventTypewhen a Methodis successfully called.

Serversshould make GeneratesEvent Referencesbidirectional References. However, it is allowed to be unidirectional when the Serveris not able to expose the inverse direction pointing from the EventTypeto each Methodgenerating the EventType.

GeneratesEvent Referencesare optional, i.e. the call of a Methodmay produce Eventsof an EventTypethat is not referenced with a GeneratesEvent Referenceby the Method.

Methodsmay use additional Referencesto define relationships to other Nodes. No restrictions are placed on the types of Referencesused or on the NodeClassesof the Nodesthat may be referenced. However, restrictions may be defined by the ReferenceTypeexcluding its use for Methods. Standard ReferenceTypesare described in Clause 7.

A Methodshall always be the TargetNodeof at least one HasComponent Reference. The SourceNodeof these HasComponent Referencesshall be an Objector an ObjectType. If a Methodis called, then the NodeIdof one of those Nodesshall be put into the Call Servicedefined in OPC 10000-4as parameter to detect the context of the Methodoperation.

If the Methodis used as InstanceDeclaration(see 4.5) all Nodesreferenced with forward hierarchical Referencesshall have unique BrowseNamesin the context of this Method.

The Variablereferenced by a HasArgumentDescription ReferenceTypeshall use a BrowseNameequal to the name of the Argumentit describes. The NameSpaceof the BrowseNameshall be ignored by a Client when performing an equality check with an Argument name. For each Argumentthere shall be at most one Variablereferenced by a HasArgumentDescription ReferenceType. The Variablereferenced by the HasArgumentDescription ReferenceType shall have the same DataTypeas the Argument’s DataType.

Argumentnames shall be unique within the scope of the Method.

An example use of the HasArgumentDescription Referenceis illustrated in Figure 16. In this example an ObjectTypedefines a Methodwhich illustrates the following:

image019.png

Figure 16– Method Metadata Example