Skip to content

Reference

IOpcMethodCommand Members

Defines a command used as the implementation of a method.

Reference

IOpcMethodCommand Members ​

Type
IOpcMethodCommand
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Methods ​

CanExecute ​

Determines the value of the Executable attribute of the method (CanExecute) and therefore decides whether the Execute method can be called in general to execute the method implementation.

csharp
bool CanExecute(OpcContext context)
vbnet
Function CanExecute(context As OpcContext) As Boolean

Parameters

NameTypeDescription
contextOpcContextThe OpcReadAttributeValueContext in case there the Executable attribute is read or the OpcMethodContext in case there the method call is to be processed.

Returns

Boolean

The value true if the method can be called; otherwise the value false.

CanUserExecute ​

Determines the value of the UserExecutable attribute of the method (CanUserExecute) and therefore decides wether the Execute method can be called by the current user to execute the method implementation.

csharp
bool CanUserExecute(OpcContext context)
vbnet
Function CanUserExecute(context As OpcContext) As Boolean

Parameters

NameTypeDescription
contextOpcContextThe OpcReadAttributeValueContext in case there the UserExecutable attribute is read or the OpcMethodContext in case there the method call is to be processed.

Returns

Boolean

The value true if the method can be called; otherwise the value false.

Execute ​

Performs the tasks necessary to implement the logic associated with a specific method using the context and inputArguments specified.

csharp
void Execute(
    OpcMethodContext context,
    IList<object> inputArguments,
    IList<object> outputArguments)
vbnet
Sub Execute(
    context As OpcMethodContext,
    inputArguments As IList(Of Object),
    outputArguments As IList(Of Object))

Parameters

NameTypeDescription
contextOpcMethodContextThe OpcMethodContext which provides the contextual information required to execute the method.
inputArgumentsIList<Object>The generic list of object values to use / respect during the execution of the method.
outputArgumentsIList<Object>The generic list of object values to use for out, ref (in Visual Basic ByRef) and returned values.

Remarks

Any OPC UA related result information is to be set using the Result property of the context.

This method is (to be) only called after the call to CanExecute and CanUserExecute evaluates to the value true.