I have a confusing error. I'm trying to write a simple UaProperty on a UaServer hosted in a Schneider Electric PLC.
When I use the C++ SDK with anonymous permissions, the action succeeds with diagnostic code OpcUaBadUserPermissionDenied and the value was not written - the action fails. With user/password permissions, the action succeeds with diagnostic code 0 and the value was not written - the action also fails.
When I use the UaExpert, the value is written - the action succeeds.
Code: Select all
...
UaStatusCodeArray results;
UaDiagnosticInfos diagnostic_infos;
ServiceSettings service_settings;
service_settings.callTimeout = 30000; // 30 seconds timeout
// Initialize IN parameter nodesToWrite
UaWriteValues nodes_to_write;
nodes_to_write.create(1);
ua_node->id.copyTo(&nodes_to_write[0].NodeId);
nodes_to_write[0].AttributeId = OpcUa_Attributes_Value;
ua_value.copyTo(&nodes_to_write[0].Value.Value);
UaStatus status;
...
// Call Write service
status = session->write(service_settings, nodes_to_write, results, diagnostic_infos);
if (status.isGood())
{
logging_handler::debug(QString("Write operation completed for node %1").arg(ua_node->id_string()));
return true;
}
print_error_diagnostics();
return false;
...
Thanks for your help,
Falko Wiese.