Attribute 'TcRpcEnable'
The pragma can be used to activate a method for a Remote Procedure Call (RPC). This allows the method to be called via ADS. The TwinCAT OPC UA server needs this pragma to make the method available as an OPC UA method.
Syntax: {attribute 'TcRpcEnable'}
Insertion location: First line above the declaration part of the method.
Sample:
{attribute 'TcRpcEnable'}
METHOD M_Sum : INT
VAR_INPUT
nInput1 : INT;
nInput2 : INT;
END_VAR
Further samples:
- ADS:
- Link: TcAdsClient.InvokeRpcMethod Method (ITcAdsSymbol, Int32, .Object.)
- Document path: TwinCAT 3 \ TE1000 XAE \ Technologies \ ADS \ TwinCAT ADS .NET \ TwinCAT.Ads Namespaces \ TwinCAT.Ads Namespace \ TcAdsClient Class \ TcAdsClient Methods \ TcAdsClient.InvokeRpcMethod Method \ TcAdsClient.InvokeRpcMethod Method (ITcAdsSymbol, Int32, .Object.)
- OPC UA:
- Link: Method Call
- Document path: TwinCAT 3 \ TFxxxx | TC3 Functions \ TF6xxx – Connectivity \ TF6100 TC3 OPC UA \ Technical introduction \ Server \ PLC \ Method call