Modbus master timing and throughput rules, Trusted, Communication interface t8151b – Rockwell Automation T8xxx Trusted Communications Interface User Manual

Page 40

Advertising
background image

Trusted

TM

Communication Interface T8151B

Issue 21 Apr 10

PD-T8151B

40

3.9. Modbus Master Timing and Throughput Rules

Each Modbus message and response takes a finite time. At 9600 bits/second, a common application
may take several seconds to process all transactions. The size of each transaction is listed here to
allow timing calculations to be made. Note that each byte requires 11 bits for delivery, including start,
parity and stop bits.

Detailed information on the Modbus protocol is available on www.modbus.org.

Command

Request Packet Size

Response Packet Size

(bytes)

(bytes)

01 Read Coils

8

5, plus 1 per 8 coils (rounded up)

02 Read Discrete Inputs

8

5, plus 1 per 8 inputs (rounded up)

03 Read Holding
Registers

8

5, plus 2 per register

04 Read Input Registers

8

5, plus 2 per register

05 Write Single Coil

8

8

06 Write Single Register

8

8

15 Write Multiple Coils

9, plus 1 per 8 coils (rounded up)

8

16 Write Multiple
Registers

9, plus 2 per register

8

Table 15 Modbus Packet Sizes

As an example, the transfer of 1000 coils to a slave may be performed using code 05 or code 15.

Using code 05, 1000 messages are required. Each transaction requires 16 bytes, plus the delay in
either end in interpreting and preparing messages. Each transaction requires (8 + 8 bytes) x 11 = 176
bits. At 9600 bits/second, this takes 18.33ms. If the delay is assumed to be only 1 millisecond, 100
messages take an absolute minimum of 19.33 seconds. The practical delays are likely to extend or
even double this time. This configuration is also too large to program into a communications interface!

Using code 15, 512 coils may be set in one message. Assuming two messages of 500 coils are used,
the transaction takes (9 + 500/8) + 8 bytes x 2 messages x 11 = 1,760 bits. At 9600 bits/second, this
takes 183.3ms, plus the turnaround delay. It is possible to write this data four or five times a second if
both devices can process quickly. A faster data rate would also speed the communications link. The
coils must however be configured in a contiguous block (without gaps). It is good practice to plan a
Modbus map to include blocks of contiguous data with room for spares.

Some devices are not configured to respond to multiple write messages. If necessary, splitting the
Modbus communication across more than one port or more than one Communication Interface will
improve data rates and response times.

Advertising