You are currently viewing the content available in Vietnam. If you are looking for information for another region, please select the correct country from the top-left dropdown in the page and 'Navigate to Browse FAQs' in the Support menu.
Modbus cycle time if we speak about regular data exchanged between modbus master and modbus slave (Altivar) consists of one modbus request (master-->slave) and one response (slave-->master).
If there are more devices in the modbus network, you have to include them in modbus cycle on PLC.
As you know the request and response can consist of various telegram, e.g. read single register, read block of n-words, write 2 holding registers, etc.
So precise calculation depends on number of words in data field. The rest part is standard
Request:
3.5 bytes start of frame
1 byte slave address
1 byte function code
1 byte or 1 word starting address (depends on function code, for ATV320 it is 2 bytes)
1 byte number of bytes or words in data filed
n words of data
1 word of CRC
3.5bytes end of frame
Additionally up to 1.5x total number of bytes can be added due to tolerated gaps between each byte transfer.
In total the request takes
[13 (management) + data (number of data words x 2) ] bytes x 1.5
Now imagine modbus RTU with 8-E-1 (1 start bit, 8 data bits, 1 even parity, 1stop bit) then every byte is transmitted using 11 bits.
So request will take
[13 (management) + data (number of data words x 2) ] x 1.5 x 11 bits
If expressed in time, it is
[13 (management) + data (number of data words x 2) ] x 1.5 x11 bits / (baudrate in bits per seconds)
Example, request with writing 2 words, baud rate is 19200bits/s
(13+2x2)x1.5x11/19200 = 14.63ms
In the same way you have to include the response from slave.
Response following the write single register request (function code 6) is the same length as request.
Response following by write multiple registers request has 3.5+8+3.5 bytes.
Response following the read n-words request depends on n-words (function code 6)
Error response is shorter (3.5+4+3.5 bytes).
If there are more devices in the modbus network, you have to include them in modbus cycle on PLC.
As you know the request and response can consist of various telegram, e.g. read single register, read block of n-words, write 2 holding registers, etc.
So precise calculation depends on number of words in data field. The rest part is standard
Request:
3.5 bytes start of frame
1 byte slave address
1 byte function code
1 byte or 1 word starting address (depends on function code, for ATV320 it is 2 bytes)
1 byte number of bytes or words in data filed
n words of data
1 word of CRC
3.5bytes end of frame
Additionally up to 1.5x total number of bytes can be added due to tolerated gaps between each byte transfer.
In total the request takes
[13 (management) + data (number of data words x 2) ] bytes x 1.5
Now imagine modbus RTU with 8-E-1 (1 start bit, 8 data bits, 1 even parity, 1stop bit) then every byte is transmitted using 11 bits.
So request will take
[13 (management) + data (number of data words x 2) ] x 1.5 x 11 bits
If expressed in time, it is
[13 (management) + data (number of data words x 2) ] x 1.5 x11 bits / (baudrate in bits per seconds)
Example, request with writing 2 words, baud rate is 19200bits/s
(13+2x2)x1.5x11/19200 = 14.63ms
In the same way you have to include the response from slave.
Response following the write single register request (function code 6) is the same length as request.
Response following by write multiple registers request has 3.5+8+3.5 bytes.
Response following the read n-words request depends on n-words (function code 6)
Error response is shorter (3.5+4+3.5 bytes).