IRpcCallableInstance.InvokeRpcMethod Method

Invokes the specified method.

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

Syntax

C#

Object InvokeRpcMethod(
    string methodName,
    Object[] parameters
)

VB

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

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

IRpcCallableInstance Interface

TwinCAT.TypeSystem Namespace