Skip to content

ReadCoils method always returns true when EasyModbusServer disconnects #12

@kv1dr

Description

@kv1dr

Running ReadColis method on ModbusClient returns correct value, but when the ModbusSever disconnects, ReadCoils starts returning true.

EasyModbus library version: 5.0 (problem exists also on 4.4)

Steps I have tried:

  1. Using EasyModbus library on C# project I am calling ReadCoils(1,1)[0] every second
  2. I run EasyModbusTCP Server Simulator
  3. EasyModbus library connects to simulator and starts returning correct value
  4. I close the simulator

What happens:

  1. ReadCoils(1,1)[0] method starts returning true as, even if the previous value was false (when it was connected)
  2. Connected property of ModbusClient object is true for next second or two even when next exception is raised: System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.

What should happen:

  1. ReadCoils should raise exception or at least return previous value, when server disconnects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions