rossmann-engineering/EasyModbusTCP.NET

Modbus RTU Unit Identifier 128 and above always sending 63!

NGame1 opened this issue · 5 comments

Hi everyone,
I'm working with EasyModbus TCP on my .NET 5 project that running on Armbian.
A strange issue that I found is that when you specify a Unit Identifier above 128 (128 itself or greater) in the serial port the sent data will be like this.
63,6,0,0,0,1,86,27
witch means unit identifier is 63.
My code is:

            var client = new ModbusClient("COM4") { Baudrate = 19200, StopBits = StopBits.One, Parity = Parity.None };
            while (true)
            {
                try
                {
                    client.UnitIdentifier = 128;
                    client.Connect();
                    client.WriteSingleRegister(0, 1);
                    //Console.WriteLine(client.sendData[0]);
                    Thread.Sleep(100);
                }
                catch (Exception)
                {
                }
            }

You mean client.DataBits = 8?
Databits property is not present in ModbusClient.

Did it work?

Did it work?

I'm not at work until Saturday.
I should test it on Saturday. Also, I have to find a way to set data bits to 8 on Armbian too. That's my final destination and need to work there.
Anyhow, thanks for your quick replies.