Ankita
Ankita

Reputation: 1456

Response code indication while using Modbus RTU

I am using Modbus RTU protocol to read data. I have Slave Id = 1 and Modbus Address = 40023. I am configuring Start Address = 22. Is it correct with my Modbus Address?

If I am configuring following details:

Slave Id= 1 Baud Rate = 19200 Stop Bits = 2 Data Bits = 8 Parity = None Start Address = 22

I am reading data with following code

var master = ModbusSerialMaster.CreateRtu(port);
ushort[] registers = master.ReadHoldingRegisters(slaveId, startAddress, 1);  //2 is number of points

With these details I am getting this response in console: INFO Modbus.IO.ModbusSerialTransport - TX: 1, 3, 2, 0, 0, 184, 68

In above response I only know some of them what they indicate like first digit 1 indicate Slave Id, 3 indicate function Code, 22 indicate Start Address, 2 indicate number of points.

Can anyone please explain me remaining code? What they indicate?

Thanks!

Upvotes: 1

Views: 1296

Answers (2)

Mike
Mike

Reputation: 1

I think your console text is a request package.

Its meaning is in the image below

enter image description here

Upvotes: 0

Ronaldo
Ronaldo

Reputation: 635

Start address is encoded in two bytes (0, 22). Number of registers is also encoded in two bytes (0, 2). (37, 207) is the CRC, needed in all Modbus RTU frames.

Upvotes: 1

Related Questions