Skip to content

Reference

OpcClient.CallMethod Method

Calls the method as defined by the command specified.

Reference

OpcClient.CallMethod Method ​

Type
OpcClient
Namespace
Opc.UaFx.Client
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Members
OpcClient Members
Also in
Opc.UaFx.Client

4 overloads

OverloadDescription
CallMethod(OpcNodeId, OpcNodeId)Calls the method identified by the methodId on the object identified by the objectId specified without any input arguments.
CallMethod(OpcNodeId, OpcNodeId, IEnumerable<object>)Calls the method identified by the methodId on the object identified by the objectId specified using the parameters as the values of its input arguments.
CallMethod(OpcNodeId, OpcNodeId, params object[])Calls the method identified by the methodId on the object identified by the objectId specified using the parameters as the values of its input arguments.
CallMethod(OpcCallMethod)since v2.8Calls the method as defined by the command specified.

Exceptions (all overloads)

ExceptionCondition
OpcExceptionThe client is not connected to the server, the service execution failed or the server reported a bad status code for the call or for one of its input arguments.
ObjectDisposedExceptionThe object has been disposed of.

CallMethod(OpcNodeId, OpcNodeId) ​

Calls the method identified by the methodId on the object identified by the objectId specified without any input arguments.

csharp
public object[] CallMethod(OpcNodeId objectId, OpcNodeId methodId)
vbnet
Public Function CallMethod(
    objectId As OpcNodeId,
    methodId As OpcNodeId) As Object()

Parameters

NameTypeDescription
objectIdOpcNodeIdThe OpcNodeId of the object on which the method is to be called.
methodIdOpcNodeIdThe OpcNodeId of the method to call.

Returns

Object[]

An array of the values of the output arguments returned by the method.

Exceptions

ExceptionCondition
ArgumentExceptionThe objectId is a null identifier (see IsNull).
ArgumentNullExceptionThe objectId or methodId is a null reference (Nothing in Visual Basic).

CallMethod(OpcNodeId, OpcNodeId, IEnumerable<object>) ​

Calls the method identified by the methodId on the object identified by the objectId specified using the parameters as the values of its input arguments.

csharp
public object[] CallMethod(
    OpcNodeId objectId,
    OpcNodeId methodId,
    IEnumerable<object> parameters)
vbnet
Public Function CallMethod(
    objectId As OpcNodeId,
    methodId As OpcNodeId,
    parameters As IEnumerable(Of Object)) As Object()

Parameters

NameTypeDescription
objectIdOpcNodeIdThe OpcNodeId of the object on which the method is to be called.
methodIdOpcNodeIdThe OpcNodeId of the method to call.
parametersIEnumerable<Object>A sequence of the values to pass as the input arguments of the method.

Returns

Object[]

An array of the values of the output arguments returned by the method.

Exceptions

ExceptionCondition
ArgumentExceptionThe objectId is a null identifier (see IsNull).
ArgumentNullExceptionThe objectId, methodId or parameters is a null reference (Nothing in Visual Basic).

CallMethod(OpcNodeId, OpcNodeId, params object[]) ​

Calls the method identified by the methodId on the object identified by the objectId specified using the parameters as the values of its input arguments.

csharp
public object[] CallMethod(
    OpcNodeId objectId,
    OpcNodeId methodId,
    params object[] parameters)
vbnet
Public Function CallMethod(
    objectId As OpcNodeId,
    methodId As OpcNodeId,
    ParamArray parameters As Object()) As Object()

Parameters

NameTypeDescription
objectIdOpcNodeIdThe OpcNodeId of the object on which the method is to be called.
methodIdOpcNodeIdThe OpcNodeId of the method to call.
parametersparams Object[]An array of the values to pass as the input arguments of the method.

Returns

Object[]

An array of the values of the output arguments returned by the method.

Exceptions

ExceptionCondition
ArgumentExceptionThe objectId is a null identifier (see IsNull).
ArgumentNullExceptionThe objectId, methodId or parameters is a null reference (Nothing in Visual Basic).

CallMethod(OpcCallMethod) ​

since v2.8

Calls the method as defined by the command specified.

csharp
public object[] CallMethod(OpcCallMethod command)
vbnet
Public Function CallMethod(command As OpcCallMethod) As Object()

Parameters

NameTypeDescription
commandOpcCallMethodThe OpcCallMethod command which defines the object, the method and the values of the input arguments of the call.

Returns

Object[]

An array of the values of the output arguments returned by the method.