Session.Read() is taking very long

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
Ragnar
Jr. Member
Jr. Member
Posts: 1
Joined: 10 May 2017, 12:41

Session.Read() is taking very long

Post by Ragnar »

Hi,

I'm trying to read about 100 nodes from an OPC Server on the same machine using Session.Read(). Sadly, each of these reads takes up more than 10 seconds.
I'm relatively inexperienced when it comes to working with OPC Servers or networking in general, so maybe I'm overlooking some essential settings?

Code: Select all

for(int i = 0; i < 100; i++)
{
//creating about 100 nodes from a datasheet
     nodesToRead.Add(new ReadValueId() { NodeId = nodeId, AttributeId = Attributes.Value });
}

Code: Select all

while (true)
{
                dtn = DateTime.Now;
                List<DataValue> results = session.Read(nodesToRead,1,TimestampsToReturn.Both, new RequestSettings() { OperationTimeout = 100000 });
                Console.WriteLine(results.Count() + " items Read " + (DateTime.Now - dtn));
}
I do get the expected values, however every read takes 10-12 seconds to complete.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3073
Joined: 18 Mar 2011, 15:09

Re: Session.Read() is taking very long

Post by Support Team »

Hi Ragnar,

The server returns very slow. This is not an issue on client side.

Note: the server returns the ReadResponse after it has collected all values. So if there is one "slow" value (e.g. the server has to wait for answer of an underlying system), the whole ReadResponse will be slow.
Best regards
Unified Automation Support Team

Post Reply