You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not impossible that it's due to my own code but I'm having the following problem:
I connect to 5 modbus tcp server in a foreach loop. I try to connect and then read some values. The code is surrounded by try catches. Imagine server 1, 2, 3, and 5 is available but 4 is not available. After I get an exception on server 4, I don't get anything out of server 5 either. If I swap the place of 4 and 5, I can read values from server 5.
I don't think my "ModbusService" had any statics or dependency injected things that might be singleton. So I believe the problem must be in the library.
Any tips on how I could diagnose this?
publicDirigentService(){ModbusDevicedev1=newModbusDevice();dev1.IPEndPoint=new(IPAddress.Parse("192.168.0.2"),502);dev1.ModbusService=newModbusService();devices.Add(dev1);ModbusDevicedev2=newModbusDevice();dev2.IPEndPoint=new(IPAddress.Parse("192.168.0.3"),502);dev2.ModbusService=newModbusService();devices.Add(dev2);(...)add more devices
// Set up a timer to read values every few secondsLog.Debug("Seting up read timer");timer=newSystem.Timers.Timer(2000);timer.Elapsed+=(s,e)=>DoRead();timer.Start();}privatevoidDoRead(){foreach(vardevinin devices){try{dev.ConnectAndReadAllValues();}
catch {}}}
The text was updated successfully, but these errors were encountered:
Sorry for being so late. FluentModbus has no (known) interdependencies between individual instances so they should not affect each other. I have no clue what could cause this behavior :-(
It's not impossible that it's due to my own code but I'm having the following problem:
I connect to 5 modbus tcp server in a foreach loop. I try to connect and then read some values. The code is surrounded by try catches. Imagine server 1, 2, 3, and 5 is available but 4 is not available. After I get an exception on server 4, I don't get anything out of server 5 either. If I swap the place of 4 and 5, I can read values from server 5.
I don't think my "ModbusService" had any statics or dependency injected things that might be singleton. So I believe the problem must be in the library.
Any tips on how I could diagnose this?
The text was updated successfully, but these errors were encountered: