The Qt Documentation provides the method
bool QOpcUaNode::callMethod(const QString &methodNodeId, const QVector<QOpcUa::TypedVariant> &args = QVector<QOpcUa::TypedVariant>())
for calling methods on the Opc Ua Server. Regarding this Method I have 2 Questions:
What exactly is methodNodeId ? I imagine it is the Id of the Node I want to call, but if this is the case, why would the function not be static instead ?
How to call methods with 0 input arguments? trying to call
myNode->callMethod(methodNodeId)
without specifiying further arguments still returnsBadTooManyArguments
, but there is really not other way I could see it being used.
An OPC UA Call Service Request need to contain an Array of
CallMethodRequest
A CallMethod Request is defined as following in the OPC UA Specification:QOpcUaNode
You will have to check your Method definition and maybe your server. Your call of
callMethod(methodId)
without arguments is fine. Depending of the Method you are calling, this call might succeed or not.Anyway your OPC UA Server might also have an issue sending
Bad_TooManyArguments
instead ofBad_ArgumentsMissing
if it was waiting for some inputArguments you did not provide.