Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Capacity Modbus RTU Server

Capacity Modbus RTU Server 4 years 3 months ago #10457

  • SS48
  • SS48's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 2
  • Karma: 0
How many registers can be created on Modbus RTU Server? And how much can you create Units (slave)??
/Sergey
Last Edit: 4 years 3 months ago by SS48.
The administrator has disabled public write access.

Capacity Modbus RTU Server 4 years 3 months ago #10458

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Sergey,

The total size of the input channels are limited to 256 bytes, and also the size of the output channels are limited to 256 bytes. One register allocates 2 bytes and 8 coils/descrete inputs allocates 1 byte. So if you only use registers you can use 128 input registers and 128 output registers.

If I look in the code I can see no limitation of the number of units more than the fact that it's stored in an unsigned char that limits it to 256. I don't think though that we have ever used or tested it with more than one unit.

/Claes
The administrator has disabled public write access.

Capacity Modbus RTU Server 4 years 3 months ago #10465

  • SS48
  • SS48's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 2
  • Karma: 0
Thanks, Claes!

If Modbus_RTU_Server contains several slaves - Modbus_RTU_ServerModule (eg UnitId=1 and UnitId=2), the sum of all the registers should not exceed 256 bytes (128Reg type int16)? Or can each slave have up to 128 registers??
(I'm not very strong with source code)
It would be nice to organize a server with several units, where each unit could have a Input and Output area of 256 bytes.

In my example, the Modbus_RTU_Server works well, where UnitId=1 contains 40Reg (int16) and UnitId=2 contains 44Reg (43-int16, 1-float32)

But when UnitId=1 contains 64Reg (32-float32, 32-int16) and UnitId=2 contains 40Reg (float32) - this does not work! (oversize buffer)

Thanks again for the help, Claes

/Sergey
The administrator has disabled public write access.

Capacity Modbus RTU Server 4 years 3 months ago #10473

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Sergey,

As you might have guessed, the limitation of 256 is for all slaves together. There was the same limitation in the Modbus TCP server, but this was changed so it's now unlimited. Modbus RTU though hasn't been chaged yet...

/Claes
The administrator has disabled public write access.

Capacity Modbus RTU Server 3 years 10 months ago #10659

  • SS48
  • SS48's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 2
  • Karma: 0
Hi Claes,

The Modbus_TCP_Server class also has an input/output Array[256] of UInt8 (in proview 5.6).
It seems impossible to create more than 128 registers of 16 bits or 64 registers of Float32. This threshold seems impossible to overcome.

/Sergey
The administrator has disabled public write access.

Capacity Modbus RTU Server 3 years 10 months ago #10671

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Sergey,

The server object is not changed in 5.6.1 but the io areas are allocated internally and unlimited so the input and output arrays in the object are not used any more. Still one modbus message is limited to 256 bytes.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: SS48
  • Page:
  • 1
  • 2
Time to create page: 8.809 seconds