Hello,
I've a .NET application that read everytime a list of TAGS on a Siemens PLC.
After some time the application start a Read Item Value operation but does not give any result.
Also no timeout happened.
My application runs on a pc with WIndows 7.
I initialize the OPC as follows:
MyEasyDAClient = new OpcLabs.EasyOpc.DataAccess.EasyDAClient();
EasyDAClient.SharedParameters.Machine.MachineReconnectDelay = 1000;
MyEasyDAClient.InstanceParameters.Mode.AllowAsynchronousMethod = true; // false
MyEasyDAClient.InstanceParameters.Mode.AllowSynchronousMethod = true;
MyEasyDAClient.Isolated = true;
MyEasyDAClient.InstanceParameters.HoldPeriods.ItemDetach = 5000;
MyEasyDAClient.InstanceParameters.HoldPeriods.ServerDetach = 30000;
MyEasyDAClient.InstanceParameters.HoldPeriods.TopicRead = 5000;
MyEasyDAClient.InstanceParameters.HoldPeriods.TopicWrite = 5000;
MyEasyDAClient.InstanceParameters.UpdateRates.ReadAutomatic = 10000;// Timeout.Infinite;
MyEasyDAClient.InstanceParameters.UpdateRates.WriteAutomatic = -1;// Timeout.Infinite;
MyEasyDAClient.InstanceParameters.Mode.DesiredMethod DAReadWriteMethod.Synchronous;
MyEasyDAClient.SynchronizationContext = dispatcherSynchronizationContext1;
MyEasyDAClient.InstanceParameters.Timeouts.BrowseAccessPaths = 10000;
MyEasyDAClient.InstanceParameters.Timeouts.BrowseNodes = 25000;
MyEasyDAClient.InstanceParameters.Timeouts.BrowseProperties = 20000;
MyEasyDAClient.InstanceParameters.Timeouts.BrowseServers = 20000;
MyEasyDAClient.InstanceParameters.Timeouts.GetProperty = 10000;
MyEasyDAClient.InstanceParameters.Timeouts.ReadItem = 10000;
MyEasyDAClient.InstanceParameters.Timeouts.WriteItem = 10000;
I tried with Syncronous and Asyncronous method without any change.
The function that I use to read is this:
public static object ReadItemValue(string Machine, string Server, string TAG)
{
object obj = null;
try
{
m_Mut.WaitOne();
if (OpcInitialized)
{
obj = MyEasyDAClient.ReadItemValue(Machine, Server, TAG);
}
else
throw new SVException(LoadStringWithModuleName("A100_007"));
}
catch (Exception ex)
{
throw new Exception(LoadString("A102_177") + "TAG:" + TAG, ex);
}
finally
{
m_Mut.ReleaseMutex();
}
return obj;
}
Everything seems to stop at " obj = MyEasyDAClient.ReadItemValue(Machine, Server, TAG);" without any error.
Thanks
Matteo