Only write, not read.
In fact, other RS485 tools can listen for the returned content, but the program itself does not receive the information.
Error info:
com.ghgande.j2mod.modbus.ModbusIOException: I/O failed to write
at com.ghgande.j2mod.modbus.io.ModbusRTUTransport.writeMessageOut(ModbusRTUTransport.java:278)
at com.ghgande.j2mod.modbus.io.ModbusSerialTransport.writeMessage(ModbusSerialTransport.java:109)
at com.ghgande.j2mod.modbus.io.ModbusSerialTransport.writeRequest(ModbusSerialTransport.java:96)
at com.ghgande.j2mod.modbus.io.ModbusSerialTransaction.execute(ModbusSerialTransaction.java:135)
at com.ghgande.j2mod.modbus.facade.AbstractModbusMaster.readMultipleRegisters(AbstractModbusMaster.java:237)
Expected Behavior
Can read and write
Actual Behavior
Only write, not read. In fact, other RS485 tools can listen for the returned content, but the program itself does not receive the information.
Error info: com.ghgande.j2mod.modbus.ModbusIOException: I/O failed to write at com.ghgande.j2mod.modbus.io.ModbusRTUTransport.writeMessageOut(ModbusRTUTransport.java:278) at com.ghgande.j2mod.modbus.io.ModbusSerialTransport.writeMessage(ModbusSerialTransport.java:109) at com.ghgande.j2mod.modbus.io.ModbusSerialTransport.writeRequest(ModbusSerialTransport.java:96) at com.ghgande.j2mod.modbus.io.ModbusSerialTransaction.execute(ModbusSerialTransaction.java:135) at com.ghgande.j2mod.modbus.facade.AbstractModbusMaster.readMultipleRegisters(AbstractModbusMaster.java:237)
Steps to Reproduce the Problem
serialParameters.setEncoding(Modbus.SERIAL_ENCODING_RTU); serialParameters.setEcho(true); serialParameters.setRs485Mode(true);
Specifications