Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: edits/style


Scripting_function



Panel
titleDescription

Calls a method in an OPC UA server. To make the most of this function, you'll need to be familiar with methods in the OPC UA server.


Client permissions restrictions



Panel
titleSyntax

system.opcua.callMethod(connectionName, objectId, methodId, inputs)

  • Parameters

String connectionName - The name of the OPC UA connection to the server that the method resides in.

String objectId - The NodeId of the Object Node the Method is a member of.

String methodId - The NodeId of the Method Node to call.

List inputs - A list of input values expected by the method.

  • Returns

Tuple - A tuple containing the following:

Index OrderDescription
0Resulting StatusCode for the call
1A list of StatusCode objects corresponding to each input argument
2A list of output values.
  • Scope

Gateway, Perspective Session


Panel
titleThe StatusCode Object

This function returns multiple StatusCode objects. StatusCode is a tuple, containing the following:

Index OrderDescription
0The value of the code
1The name of the code
2A description of the code




Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
# Call the Server object's GetMonitoredItems method.
result = system.opcua.callMethod(
        "Ignition OPC UA Server",
        "ns=0;i=2253",
        "ns=0;i=11492",
        [1]
    )

# Below we print the various elements in the results. The print statements could easily be replaced by something more useful.

# printsPrints the StatusCode for the call    .
print result[0]

# printsPrints the list of StatusCodes, one for each input argument passed to system.opcua.callMethod.
print result[1]

# printsPrints the output values from the call.
print result[2]



Panel
titleKeywords

system opcua callMethod, opcua.callMethod