Apollo3zehn / FluentModbus

Lightweight and fast client and server implementation of the Modbus protocol (TCP/RTU).
MIT License
188 stars 69 forks source link

client.WriteMultipleRegisters. Write error #108

Closed Seba131 closed 5 months ago

Seba131 commented 5 months ago

Hi. I have a problem with: client.WriteMultipleRegisters(unitIdentifier, startingAddress, new byte[] { 10, 00, 20, 00, 30, 00, 255, 00, 255, 01 }); client.WriteMultipleRegisters(0x01, 0x230, new byte[] { 10, 00, 20, 00, 30, 00, 255, 00, 255, 01 }); shows me errors: "Specified argument was out of the range of valid values" or "Object reference not set to an instance of an object"

ReadHoldingRegisters it works without any problems, so all settings are ok data = client.ReadHoldingRegisters<byte>(unitIdentifier, startingAddress, 10);

Apollo3zehn commented 5 months ago

Could you please also post the stack trace? Thanks :-)

Seba131 commented 5 months ago

Czy mógłbyś również opublikować ślad stosu? Dzięki :-)

Ok, my error in the code works. I implemented BaudRate and Parity incorrectly. ModBus transmission is well written, I RECOMMEND. Thank you for your interest in my problem.