Calls a method on the server. More...
Import Statement: | import QtOpcUa |
Since: | QtOpcUa 5.12 |
Inherits: |
This QML element supports calling method nodes on a server. The target object node ID has to be specified by the objectNodeId property.
import QtOpcUa as QtOpcUa QtOpcUa.MethodNode { nodeId : QtOpcUa.NodeId { identifier: "s=Example.Method" ns: "Example Namespace" } objectNodeId : QtOpcUa.NodeId { identifier: "s=Example.Object" ns: "Example Namespace" } connection: myConnection }
The actual function call can be triggered by a signal.
Button { text: "Start" onClicked: myNode.callMethod }
or by JavaScript
myNode.callMethod()
inputArguments : list<MethodArgument> |
Arguments to be used when calling the method on the server.
This example shows how to call a method with two double arguments.
QtOpcUa.MethodNode { ... inputArguments: [ QtOpcUa.MethodArgument { value: 3 type: QtOpcUa.Constants.Double }, QtOpcUa.MethodArgument { value: 4 type: QtOpcUa.Constants.Double } ] }
See also callMethod.
objectNodeId : OpcUaNode |
Determines the actual node on which the method is called. It can be a relative or absolute node Id.
Returns values from the method call. Depending on the output arguments, this list may contain zero or more values. The resultStatus has to be checked separately. In case the method call failed, the list will be empty.
if (node.status.isGood) { // print two arguments console.log("Number of return values:", node.outputArguments.length) console.log("Return value #1:", node.outputArguments[0]) console.log("Return value #2:", node.outputArguments[1]) }
See also callMethod and resultStatus.
[read-only] resultStatus : Status |
Status of the last method call. This property has to be checked to determine if the method call was successful.
See also Status.
type : QOpcUa::Types |
Sets the type of the argument that is expected by the server. The value variant is converted to that type when calling the method. The type has to match the method on the server exactly, otherwise the method call will fail.
See also MethodNode::callMethod.
callMethod() |
Calls the method on the connected server.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: