Apollo3zehn / FluentModbus

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

WriteMultipleRegisters Error #61

Closed petranodavide closed 2 months ago

petranodavide commented 2 years ago

Hi, I would need to write an alphanumeric value inside a register, in particular the one with address 208. For example: Test2022 I noticed the instruction below client.WriteMultipleRegisters (machine.unitIdentifier, 208, new byte [] {084, 101, 115, 116, 050, 048, 050, 050}); it doesn't work as it should. The machine displays only the value 2 (050). I want to clarify that the machine's Endianness is Little. what am I doing wrong? thank you

Apollo3zehn commented 2 years ago

I am not sure what went wrong. I have tried to reproduce your issue with the "Modbus slave" application (www.modbustools.com) as shown here, and its working fine:

image

image

You could try to transmit only 2 bytes per request and use "WriteSingleRegister" two times to write the value.