DynamicRpcStructInstance.InvokeRpcMethod Method

Invokes the specified method.

Namespace:  TwinCAT.TypeSystem
Assembly:  TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 4.3.0.0

Syntax

C#

public Object InvokeRpcMethod(
    string methodName,
    Object[] parameters
)

VB

Public Function InvokeRpcMethod ( 
    methodName As String,
    parameters As Object()
) As Object

Parameters

methodName

Type: System.String
Name of the method.

parameters

Type: .System.Object.
The parameters.

Return Value

Type: Object
The return value of the RPC Method

Implements

IRpcCallableInstance.InvokeRpcMethod(String, .Object.)

Remarks

To indicate a PLC Method for remote ads access, the attribute 'TcRpcEnable' must be declared on the method declaration (see example).

Examples

RPC Method definition and implementation

(* Declaration *)
{attribute 'TcRpcEnable'}
METHOD RpcMethod1 : INT
VAR_INPUT
i1 : INT;
END_VAR
(* Implementation *)
RpcMethod1 := i1 + 1;

Reference

DynamicRpcStructInstance Class

TwinCAT.TypeSystem Namespace