titanium-as / TitaniumAS.Opc.Client

Open source .NET client library for OPC DA
MIT License
197 stars 93 forks source link

Synchronous read exception "Value does not fall within expected range" #61

Open Rarroyo94 opened 3 years ago

Rarroyo94 commented 3 years ago

I'm trying to synchronously read a node from the OPC server using the example as given in the documentation.

OpcDaItemValue[] values = group.Read(group.Items, OpcDaDataSource.Device);

My issue is that it works on a regular basis but after a period of time I start getting the exception:

Value does not fall within the expected range.

I have a while loop that reads the node synchronously every minute, would that be a potential issue? Any information is appreciated.

qcpaul commented 1 year ago

the same thing happened to me, but i figured out why it happened in my case, firstly i added a tag branch from one OPC server in one group, then i connected to another different OPC server and added a tag branch from this other server to another group , so I have 2 groups that each belong to two different servers, when I try to read both groups connected to one of the two servers (I can connect to only one, not both, obviously) the group that does not belong to is server no can be read and "does not fall within range", it seems the reason is simple and the solution obvious.