We have an OPC Client made using QuickOPC-UA and I think it's very slow!
We have the refresh set to 50 ms
The part that seems slow is the write! For every read the client will write the same value in a "new" tag.
E.g. The client reads tag Foo with value 1, it then write to the tag Bar with the same value. A safety thing (I'm told by the programmer which has left the building)
The feeling is that from the time the PLC sets the value to the value is written by the client it takes just about a second!
We have checked the time on the PLC!
We have a subscription on the tag and in the event handler we check that the tag is correct and then write its value to the response tag.
We are using MatrikonOPC UCS with Modbus plug-in and Mitsubishi PLC Plug-in (different machines)
The writing is done like this
SendMultipleValues(new[] { new UAWriteValueArguments(ServerEndPoint, GetNode(OPCSettings.OrvarCavityGrp, OPCSettings.OrvarCavity), value) });
public static void SendMultipleValues(UAWriteValueArguments[] arguments)
{
try
{
var sendResult = EasyUAClientWrite.WriteMultipleValues(arguments);
if (Settings.Debug < (int)DebugLogLevel.Medium) return;
var resultString = "OPCWorker - OPC WriteMultipleValues: \n";
var iterator = 0;
foreach (var item in sendResult)
{
resultString += arguments[iterator].NodeDescriptor.ToString().Split('/').Last() + " = " + arguments[iterator].Value + " : " + item + "\n";
iterator++;
}
LogHelper.LogInfo(resultString);
}
catch (UAServiceException ex)
{
LogHelper.LogError(ex.Message);
if (Settings.Debug >= (int)DebugLogLevel.Medium)
LogHelper.LogInfo("OPCWorker - Reset EasyUAClientWrite");
EasyUAClientWrite.Reset();
if (Settings.Debug >= (int)DebugLogLevel.Medium)
LogHelper.LogInfo("OPCWorker - Try to resend after reset...");
var sendResult = EasyUAClientWrite.WriteMultipleValues(arguments);
if (Settings.Debug >= (int)DebugLogLevel.Medium)
{
var resultString = "OPCWorker - OPC WriteMultipleValues: \n";
var iterator = 0;
foreach (var item in sendResult)
{
resultString += arguments[iterator].NodeDescriptor.ToString().Split('/').Last() + " = " + arguments[iterator].Value + " : " + item + "\n";
iterator++;
}
LogHelper.LogInfo(resultString);
}
}
}
Can anyone see something that would make the write slow?