EasyModbusTCP.NET
EasyModbusTCP.NET copied to clipboard
When the CRC fails, the system enters an infinite loop
When the slave machine continuously receives incorrect response and CRC check fails, the stack overflow will occur in an infinite loop
if (receivedUnitIdentifier != this.unitIdentifier) data = new byte[2100]; else countRetries = 0;
if ((crc[0] != data[data[8]+9] | crc[1] != data[data[8]+10])& dataReceived) { if (debug) StoreLogData.Instance.Store("CRCCheckFailedException Throwed", System.DateTime.Now); if (NumberOfRetries <= countRetries) { countRetries = 0; throw new EasyModbus.Exceptions.CRCCheckFailedException("Response CRC check failed"); } else { countRetries++; Console.WriteLine("countRetries:{0}", countRetries); return ReadHoldingRegisters(startingAddress, quantity); } }