Closed ghost closed 6 years ago
Hi there:
For the record: (years later)
The field serialport (of the class SerialPort ) is private but you can expose using reflection
modbusClient = new ModbusClient("COM3");
var prop = modbusClient.GetType().GetField("serialport", System.Reflection.BindingFlags.NonPublic
| System.Reflection.BindingFlags.Instance);
// Then you can change the dtr field.
SerialPort sp= (SerialPort) prop.GetValue(modbusClient);
sp.DtrEnable=true;
You can also recompile the project and add a property to change it.
Hi there,
Some older RS-232/RS-485 converters rely on power from the RS-232 handshake lines. However, by default Easymodbus disables these lines which means the converters are unable to transfer the data back/forth.
Add RTS and DTR control to the component.
Regards, Darren