Methodsrepresent the function calls of Objects. They are defined in OPC 10000-3. Methodsare invoked and return only after completion (successful or unsuccessful). Execution times for Methodsmay vary, depending on the function that they perform.

The Method Service Setdefines the means to invoke Methods. A Methodshall be acomponentof an Object. Discovery is provided through the Browseand Query Services. Clientsdiscover the Methodssupported by a Serverby browsing for the owning Objects Referencesthat identify their supported Methods.

Because Methodsmay control some aspect of plant operations, Methodinvocation may depend on environmental or other conditions. This may be especially true when attempting to re-invoke a Methodimmediately after it has completed execution. Conditions that are required to invoke the Methodmight not yet have returned to the state that permits the Methodto start again.

This Serviceis used to call (invoke) a list of Methods.

This Serviceprovides for passing input and output arguments to/from a Method. These arguments are defined by Propertiesof the Method.

If the Methodis invoked in the context of a Sessionand the Sessionis terminated, the results of the Method’sexecution cannot be returned to the Clientand are discarded. This is independent of the task actually performed at the Server.

The order the operations are processed in the Serveris not defined and depends on the different tasks and the internal Serverlogic. If a Methodis contained in more than one operation, the order of the processing is undefined. If a Clientrequires sequential processing the Clientneeds separate Servicecalls.

Table 65defines the parameters for the Service.

Table 65– Call Service Parameters

Name

Type

Description

Request

requestHeader

RequestHeader

Common request parameters (see 7.33for RequestHeaderdefinition).

methodsToCall []

CallMethodRequest

List of Methodsto call. This structure is defined in-line with the following indented items.

objectId

NodeId

The NodeIdshall be that of the Objector ObjectTypeon which the Methodis invoked.

In case of an ObjectTypethe ObjectTypeor a super type of the ObjectTypeshall be the source of a HasComponent Reference (or subtype of HasComponent Reference) to the Methodspecified in methodId.

In case of an Objectthe Objector the ObjectTypeof the Objector a super type of that ObjectTypeshall be the source of a HasComponent Reference(or subtype of HasComponent Reference) to the Methodspecified in methodId.

See OPC 10000-3for a description of Objectsand their Methods.

methodId

NodeId

NodeIdof the Methodto invoke.

If the objectIdis the NodeIdof an Object, it is allowed to use the NodeIdof a Methodthat is the target of a HasComponent Referencefrom the ObjectTypeof the Object.

inputArguments []

BaseDataType

List of input argument values. An empty list indicates that there are no input arguments. The size and order of this list matches the size and order of the input arguments defined by the input InputArguments Propertyof the Method.

The name, a description and the data type of each argument are defined by the Argumentstructure in each element of the method’s InputArguments Property.

Fewer arguments than the total number of input arguments defined may be passed by the Clientwhen optional input arguments are defined. A Methodmay define input arguments as optional by including HasOptionalInputArgumentDescriptionreferences to argument metadata. The InputArguments Propertyand the HasOptionalInputArgumentDescription ReferenceTypeare defined in OPC 10000-3.

Response

responseHeader

ResponseHeader

Common response parameters (see 7.34for ResponseHeaderdefinition).

results []

CallMethodResult

Result for the Methodcalls. This structure is defined in-line with the following indented items.

statusCode

StatusCode

StatusCodeof the Methodexecuted in the Server. This StatusCodeis set to the Bad_InvalidArgument StatusCodeif at least one input argument broke a constraint (e.g. wrong data type, value out of range).

This StatusCodeis set to a bad StatusCodeif the Methodexecution failed in the Server, e.g. based on an exception.

If the Methodexecution fails but the outputArgumentsprovide additional information like an application specific error code, the Methodshould return aStatusCodewith Severity Uncertain.

inputArgumentResults []

StatusCode

List of StatusCodescorresponding to the inputArguments.

This list is empty unless the operation level result is Bad_InvalidArgument.

If this list is populated, it has the same length as the inputArgumentslist.

inputArgumentDiagnosticInfos []

DiagnosticInfo

List of diagnostic information corresponding to the inputArguments. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.

outputArguments []

BaseDataType

List of output argument values. An empty list indicates that there are no output arguments. The size and order of this list matches the size and order of the output arguments defined by the OutputArguments Propertyof the Method.

The name, a description and the data type of each argument are defined by the Argumentstructure in each element of the methods OutputArguments Property.

The list shall be empty if the statusCode Severityis Bad.

diagnosticInfos []

DiagnosticInfo

List of diagnostic information for the statusCodeof the results. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.

Table 66defines the Serviceresults specific to this Service. Common StatusCodesare defined in Table 182.

Table 66– Call Service Result Codes

Symbolic Id

Description

Bad_NothingToDo

See Table 182for the description of this result code.

Bad_TooManyOperations

See Table 182for the description of this result code.

Table 67defines values for the statusCodeparameterand Table 68defines values for theinputArgumentResultsparameter that are specific to this Service. Common StatusCodesare defined in Table 183.

Servervendors or OPC UA companion specifications may reuse existing StatusCodesfor application specific error information. This is valid as long as the canonical description of the StatusCode does not have a different meaning than the application specific description. To eliminate any vagueness, the Servershould include the application specific description in the DiagnosticInfo.

Good StatusCodeswith sub-status shall not be used as statusCodesince many programming language bindings would cause such codes to throw an exception.

Table 67– Call Operation Level Result Codes

Symbolic Id

Description

Bad_NodeIdInvalid

See Table 183for the description of this result code.

Used to indicate that the specified Objectis not valid.

Bad_NodeIdUnknown

See Table 183for the description of this result code.

Used to indicate that the specified Objectis not valid.

Bad_NotExecutable

The executable Attributedoes not allow the execution of the Method.

Bad_ArgumentsMissing

The Clientdid not specify all of the non-optional input arguments for the Method.

Bad_TooManyArguments

The Clientspecified more input arguments than defined for the Method.

Bad_InvalidArgument

See Table 182for the description of this result code.

Used to indicate in the operation level results that one or more of the input arguments are invalid. The inputArgumentResultscontain the specific status code for each invalid argument.

Bad_UserAccessDenied

See Table 182for the description of this result code.

Bad_SecurityModeInsufficient

See Table 183for the description of this result code.

Bad_MethodInvalid

The method id does not refer to a Methodfor the specified Object.

Bad_NoCommunication

See Table 183for the description of this result code.

Table 68– Call Input Argument Result Codes

Symbolic Id

Description

Bad_OutOfRange

See Table 183for the description of this result code.

Used to indicate that an input argument is outside the acceptable range.

Bad_TypeMismatch

See Table 183for the description of this result code.

Used to indicate that an input argument does not have the correct data type.

A ByteStringis structurally the same as a one dimensional array of Byte. A Servershall accept a ByteStringif an array of Byteis expected.