0
My application performs reading 24 tags from a Rslinx Classic localhost server.
However, I started to notice that the reading of the tags are faster when the Matrikonopc Explorer software is running and reading the same tags of my application.
When the Matrikonopc Explorer is closed the reading of the 24 tags lasts from around 180ms to 220ms. But when the same is open and running the reading of the same tags simultaneously the reading time of my application is around 30ms!
Here is the backgroudworker event used for continuous reading of OPC tags:
void workerGroupRead_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker _worker = (BackgroundWorker)sender;
ItemValueResult[] values;
if (listOPCItems != null && listOPCItems.Count > 0)
{
if (items != null && items.Length > 0)
{
while (!_worker.CancellationPending)
{
stopwatchReader.Restart();
System.Threading.Thread.Sleep(10)
try
{
if (IsConnected && !_worker.CancellationPending)
{
values = server.Read(items);
ReadValuesResult(values);
}
TempoLeitura = stopwatchReader.ElapsedMilliseconds;
}
catch
{
stopwatchReader.Reset();
break;
}
}
}
}
}
I already checked the DCOM settings and permissions and found nothing that seemed obvious to me.
In case anyone has any suggestions, thank you in advance.
The error actually occurred in the boot process. No Opc tags were being initialized in my application. The reading group was created by Matrikonopc when it was opened and configured to read the same set of tags as my application. Thanks for the help!
– Jheferson