Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

ServerRPC

  • Last UpdatedJul 18, 2023
  • 2 minute read

Calls a remote procedure on the Plant SCADA server specified by the ServerName argument. You can call any of the built-in Cicode functions remotely, or your own functions. You pass the Name of the function as a string and pass the arguments for that function in Arg.

You can call the function in synchronous or asynchronous mode. In synchronous mode, ServerRPC() does not return until the function call has completed on the server and the result is returned. In asynchronous mode, ServerRPC() returns before the function is called, an empty string is returned as the result cannot be returned.

This means this function is a blocking function if iMode is set to zero (0). A logged on user is required for this function to be successful.

Note: The Allow RPC property for a Role determines if a user or group of users can perform remote MsgRPC and ServerRPC calls. This functionality now requires a user-specific permission. To allow existing users to use MsgRPC and ServerRPC, you need to manually change the value of Allow RPC to "TRUE" in Plant SCADA Studio’s Security | Roles view. You also need to set the Allow RPC property to "TRUE" for each server process that these functions will access.

Syntax

ServerRPC(sServerName, sName, sArg, iMode [, sClusterName])

sServerName:

Plant SCADA server name where the Cicode function needs to be executed. You can optionally specify this name in <ClusterName>.<ServerName> syntax.

sName:

The name of the Cicode function to call remotely as string.

sArg:

The arguments to pass to the function, separated by commas (,).Enclose string arguments in quotes "" and use the string escape character (^) around strings enclosed within a string. If you forget to enclose the string in quotes, then the string is only the first tag found.

iMode:

The mode of the call:

0 - Blocking mode - synchronous

1 - Non-blocking mode - asynchronous

sClusterName:

The name of the cluster that the server resides in. This argument is optional, as in several situations it may not be required. In single cluster systems, it is not required, or if the current Cicode task already has the correct cluster context for the server you may omit this argument.

Return Value

The result of the remote function call (as a string). If the function is called in asynchronous mode the result of the remote function cannot be returned, so an empty string is returned. If the function cannot work due to an error, empty string is also returned and the error can be obtained by calling the IsError function. If current user has view-only access on client side, the function will return an error code.

Note: The error code 513 will be returned if the Allow RPC property is not set to TRUE in an associated Role or server process.

TaskNew, TaskNewEx

See Also

Task Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in