Modbus RTU Protocol Timing Evaluation for Scattered Holding Register Read and ModbusE-Related Implementation
Abstract
:1. Introduction
2. Related Work
Bus Model | Communication Type | Transmission Speed | Bus Topology | Devices Number | Protocol Type | Transmission Media | Specific Implementation Sector |
---|---|---|---|---|---|---|---|
ModbusRTU | Serial (RS-232/RS-422/RS-485) | Up to 115.2 kbps | Daisy Chain/Bus | 32 per segment (can be extended to 247 devices with repeaters) | Master–Slave (Single Master) | Twisted pair (RS-485) | Industrial automation and SCADA |
Modbus TCP | Ethernet | 100 Mbps | Daisy Chain, Star, Tree | Up to 247 servers | Master–slave (client–server) | Ethernet TCP/IP (port 502) | Control systems, industrial automation |
ModbusE | Serial (RS-485/RS-232) | 27 Mbit/s | Bus | 247 devices with repeaters | Client/server | RS-485 on twisted pair | BIoT, Industrial automation |
DeviceNet | Serial (CAN-based) | 125 kbit/s, 250 kbit/s and 500 kbit/s | Bus | 64 nodes | Producer/Consumer | Twisted pair (CAN) | Industrial devices, safety devices, large I/O control networks |
KNX [30] | Serial (RS-232/RS-485) | 9.6 kbit/s (termination resistors not required) | Tree, line or star | Up to 256 per line | Peer-to-Peer, one-to-many, centralized master–slave | Twisted-pair cable, IP, radio or Power line | Building automation, energy management, air-conditioning control (HVAC), security systems, |
LonWorks | Ethernet, TP/FT, Serial | 5.4 or 3.6 Kbps (Power line), 78 Kbps (TP/FT) | Free topology | 32,385 (127 devices within a domain, up to 255 subnets) | Peer-to-Peer | Twisted pair, fiber optics, wireless Power line | BIoT, HVAC |
BACnet | Serial (RS-232, RS-485, Ethernet) | 76.8 kbit/s (MS/TP) | line topology | 255 (127 master devices) | Peer-to-Peer, Master–Slave Token Passing (MS/TP) | Twisted pair | Building automation, HVAC, lighting control, access control |
Interbus-S | Serial (RS-485 based) | 500 kbps | Active ring (Closed-Loop) | 512 devices (16 levels of networks) | Master–Slave | Twisted pair (RS-485) | Process engineering, sensor/actuator, machine production |
EtherCAT [31] | Serial (Ethernet) | 100 Mbit/s | Line, ring, and star | 65,535 devices on segment | Master-to-slave | Twisted pair, fiber optic | Machine controls |
CANOpen | Serial (CAN-based) | Up to 1 Mbit/s | Bus | 64 recommended (127 max) | Multi-Master (message and data types) | Twisted pair (CAN) | Industrial machinery, automotive |
3. Communication and Application Aspects of the Modbus RTU Transmission Mode
- Modbus is a request/response protocol that provides services specified by function codes;
- Modbus function codes are elements of Modbus request/response PDUs, making up a Modbus transaction.
- TCP/IP over Ethernet described in the Modbus Message Implementation Guide.
- Asynchronous serial transmission over a variety of media such as wired (EIA/TIA-232-E, EIA-422, EIA/TIA-485-A), fiber optic, radio, etc.
- Modbus PLUS, which is a high-speed token passing-type network.
- The coding system is binary (eight-bit);
- Bits per byte:
- ➢
- One start bit;
- ➢
- Eight data bits with the LSB sent first;
- ➢
- One parity bit;
- ➢
- One stop bit.
4. Modbus RTU Protocol Timing Evaluation for Uploading Data Memorized at Scattered Addresses and Proposed ModbusE
4.1. The Function That Defines a Modbus AC
- FC03 (3 in decimal, 0x03 in hex) Read Holding Register: this function code is utilized to read the contents of a contiguous block of holding registers in a remote device.
- FC06 (6 in decimal, 0x06 in hex) Write Single Register: this function code is used to write a single holding register to a remote device.
- FC10 (16 in decimal, 0x10 in hex) Write/Set Multiple Holding Registers: this function code is used to write a block of contiguous registers (1 to 123 registers) to a remote device.
- FC22 (22 in decimal, 0x16 in hex) Mask Write Register: this function code is used to modify the contents of a specified holding register using a combination of an AND mask, an OR mask and the current contents of the register.
- FC23 (23 in decimal, 0x17 in hex) Read/Write Multiple Registers: this function code performs a combination of a read operation and a write operation in a single Modbus transaction.
- (1)
- Specific server application;
- (2)
- The RTOS or sequencer (an RTOS was used for testing);
- (3)
- The serial communication driver.
- Consecutive, non-blank addresses of Modbus RTU server-type devices;
- Scattered addresses with gaps and with or without consecutive address sequences;
- Interleaved repeating addresses with different control functions or the same control function;
- Performing operations such as reading from one station and sending the value to another station on the same network or on a network connected to another virtual COM or to a Modbus TCP/IP gateway that remotely sends values to another client of a local virtual COM, etc.
- SMARTConvert application;
- The operating system, in the case of the lab tests using Windows 10;
- The sniffer that monitors messages on the virtual COMx (Modbus Poll, Witte Software, v. 7.2, 2019);
- USB driver.
4.2. Customization of Modbus Communication Equations Depending on the Considered Acquisition Cycle
(5,3,3,1), (5,3,5,1), (5,3,7,1), (5,3,9,1), (5,3,11,1), (5,3,13,1), (5,3,15,1),
(5,3,17,1), (5,3,19,1), (5,3,21,1), (5,3,23,1), (5,3,25,1), (5,3,27,1), (5,3,29,1),
(5,3,31,1), (5,3,33,1), (5,3,35,1), (5,3,37,1), (5,3,39,1), (5,3,41,1), (5,3,43,1),
(5,3,45,1), (5,3,47,1), (5,3,49,1), (5,3,51,1), (5,3,53,1), (5,3,55,1), (5,3,57,1),
(5,3,59,1), (5,3,61,1), (5,3,63,1), (5,3,65,1), (5,3,67,1), (5,3,69,1), (5,3,71,1),
(5,3,73,1), (5,3,75,1), (5,3,77,1), (5,3,79,1), (5,3,81,1), (5,3,83,1), (5,3,85,1),
(5,3,87,1), (5,3,89,1), (5,3,91,1), (5,3,93,1), (5,3,95,1), (5,3,97,1), (5,3,99,1),
(5,3,101,1) }
- If the message is received correctly, then t_TF03i and tAC are calculated with Equations (14) and (15) as follows:t_TF03i (FC03,α1,0,0,1) = (20 + 1 × (2 +3 α) + 18 α) × 10 × 104.17 = (22 + 21 α) × 1041.7 = 22917.4 + 21875.7 α (us) = 22.9174 + 21.8757 α (ms)tAC = 50 × tAlli(5,FC03,1) + 50 × (22.9174 + 21.8757 α) (ms)tAC = 50 × tAlli(5,FC03,1) + 1145.87+ 1093.785 α (ms)
- If for Equation (16) the parameter α is 1, thentAC = 50 × tAlli(5,FC03,1) + 2239.655 (ms)
- If α = 0, then the AC time becomestAC = 50 × tAlli(5,FC03,1) + 1145.87 (ms)
- In case of an error message, the function t_TF03i can be written with Equation (19).t_TF03i(FC03,α,1,0,x) = t_TF03ERR = (20 + 18 α) × 1041. 7 = 20,834 + 18,750.6 α
- If α = 1, thent_TF031(FC03,1,1,0,x) = 39,584.6 (us) = 39.5846 (ms)tAC = 50 × tAll (5,FC03,1) + 1979.23 (ms)
- If α is zero, thent_TF031(FC03,0,1,0,x) = 20,834 (us) = 20.834 (ms)tAC = 50 × tAll(5,FC03,1) + 1041.7 (ms)
- For the case of a timeout, with multiple transactions, it is harder to pinpoint the time period associated with this delay. Any timeout adds about TOUT-50 ms, where TOUT is around 500 ms, and scattering the regions certainly adds additional time to read them.
4.3. Modbus Communication Platform Testing for the Case When Registers Are at Scattered Addresses
- STM32F746NGH6 microcontroller (produces by STMicroelectronics, Geneva, Switzerland) equipped with 1MB of flash memory and 340 KB of RAM [35];
- On the board flash programming support and ST-link/V2-1 debugging with USB connection;
- 128 Mbit flash memory with Quad-SPI connection and 128 Mbit SDRAM (64 Mbit accessible);
- MicroSD card connector, Arduino Uno V3 connector and 4.3 inch 480 × 272 color LCD-TFT with capacitive touch screen;
- Free software that includes a multitude of examples, part of the STM32Cube package.
4.4. Proposed ModbusE and Its Advantages
5. Discussion
6. Conclusions
7. Patents
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Pleinevaux, P.; Decotignie, J.-D. Time critical communication networks: Field buses. IEEE Netw. 1988, 2, 55–63. [Google Scholar] [CrossRef]
- Kiangala, K.S.; Wang, Z. An Effective Communication Prototype for Time-Critical IIoT Manufacturing Factories Using Zero-Loss Redundancy Protocols, Time-Sensitive Networking, and Edge-Computing in an Industry 4.0 Environment. Processes 2021, 9, 2084. [Google Scholar] [CrossRef]
- Reyes, N.A.; Cerrato, H.I. Modbus TCP Bridging for Interconnecting Non-Compatible Devices in the Energy Sector Using Node-RED and Edge Computing. In Proceedings of the 2023 IEEE 41st Central America and Panama Convention (CONCAPAN XLI), Tegucigalpa, Honduras, 8–10 November 2023; pp. 1–4. [Google Scholar] [CrossRef]
- Rodriguez-Perez, N.; Domingo, J.M.; Lopez, G.L.; Stojanovic, V. Scalability Evaluation of a Modbus TCP Control and Moni-toring System for Distributed Energy Resources. In Proceedings of the 2022 IEEE PES Innovative Smart Grid Technologies Conference Europe (ISGT-Europe), Novi Sad, Serbia, 10–12 October 2022; pp. 1–6. [Google Scholar] [CrossRef]
- Biondani, F.; Cheng, D.S.; Fummi, F. Adopting OPC UA for Efficient and Secure Firmware Transmission in Industry 4.0 Scenarios. In Proceedings of the 2024 IEEE 33rd International Symposium on Industrial Electronics (ISIE), Ulsan, Republic of Korea, 18–21 June 2024; pp. 1–6. [Google Scholar] [CrossRef]
- Zurawski, R. The Industrial Communication Technology Handbook; CRC Press: Boca Raton, FL, USA, 2015; ISBN-13:978-1-4822-0733-0. [Google Scholar]
- Kohútka, L.; Stopjaková, V. Extension of hardware-accelerated real-time task schedulers for support of quad-core processors. In Proceedings of the 2017 5th IEEE Workshop on Advances in Information, Electronic and Electrical Engineering (AIEEE), Riga, Latvia, 24–25 November 2017; pp. 1–6. [Google Scholar] [CrossRef]
- Available online: www.modbus.org (accessed on 22 July 2022).
- Lazaridis, G.; Drosou, A.; Chatzimisios, P.; Tzovaras, D. Securing Modbus TCP Communications in I4.0: A Penetration Test-ing Approach Using OpenPLC and Factory IO. In Proceedings of the 2023 IEEE Conference on Standards for Communica-tions and Networking (CSCN), Munich, Germany, 6–8 November 2023; pp. 265–270. [Google Scholar] [CrossRef]
- Găitan, V.G.; Găitan, N.C.; Ungurean, I. A flexible acquisition cycle for incompletely defined fieldbus protocols. ISA Trans. 2014, 53, 776–786. [Google Scholar] [CrossRef] [PubMed]
- Zagan, I.; Găitan, V.G. Enhancing the Modbus Communication Protocol to Minimize Acquisition Times Based on an STM32-Embedded Device. Mathematics 2022, 10, 4686. [Google Scholar] [CrossRef]
- Găitan, N.C.; Zagan, I.; Găitan, V.G. Proposed Modbus Extension Protocol and Real-Time Communication Timing Requirements for Distributed Embedded Systems. Technologies 2024, 12, 187. [Google Scholar] [CrossRef]
- Găitan, V.G.; Zagan, I. Modbus Protocol Performance Analysis in a Variable Configuration of the Physical Fieldbus Architecture. IEEE Access 2022, 10, 123942–123955. [Google Scholar] [CrossRef]
- Găitan, V.G.; Zagan, I. Modbus Extension Server Implementation for BIoT-Enabled Smart Switch Embedded System Device. Sensors 2024, 24, 475. [Google Scholar] [CrossRef] [PubMed]
- Kurose, J.F.; Ross, K.W. Computer Networking: A Top-Down Approach; Addision Wesley: Boston, MA, USA, 2017; ISBN-10: 1-292-15359-8, ISBN-13: 978-1-292-15359-9. [Google Scholar]
- Jiang, M.; Wu, G.; Qiao, W.; Chen, X.; Fang, J.; Xie, M. Design of Profibus-DP module based on APC3 chip. In Proceedings of the 2024 7th International Conference on Energy, Electrical and Power Engineering (CEEPE), Yangzhou, China, 26–28 April 2024; pp. 1260–1264. [Google Scholar] [CrossRef]
- Actuator Sensor Interface. Available online: https://www.as-interface.net/ (accessed on 20 July 2024).
- Ghosh, T.; Bagui, S.; Bagui, S.; Kadzis, M.; Bare, J. Anomaly Detection for Modbus over TCP in Control Systems Using Entropy and Classification-Based Analysis. J. Cybersecur. Priv. 2023, 3, 895–913. [Google Scholar] [CrossRef]
- Tovar, E.; Vasques, F.; Burns, A. Adding local priority-based dispatching mechanisms to P-NET networks: A fixed priority approach. In Proceedings of the 11th Euromicro Conference on Real-Time Systems. Euromicro RTS’99, York, UK, 9–11 June 1999; pp. 175–184. [Google Scholar] [CrossRef]
- Nawrocki, G.J.; Arnold, N.D.; Hoffberg, M.G.; Winans, J.R.; Benes, S.J. An I/O subnet for the APS control system-the BITBUS universal gateway. In Proceedings of the International Conference on Particle Accelerators, Washington, DC, USA, 17–20 May 1993; Volume 3, pp. 1957–1959. [Google Scholar] [CrossRef]
- Feng, T.; Liu, C.; Gong, X.; Lu, Y. Security Analysis and Enhancement of INTERBUS Protocol in ICS Based on Colored Petri Net. Information 2023, 14, 589. [Google Scholar] [CrossRef]
- Zhou, Y.; Yu, H.; Wang, T.; Wang, Z.; Wu, C. DSPN model and performance analysis of WorldFIP MAC sub-layer. In Proceedings of the 30th Annual Conference of IEEE Industrial Electronics Society, 2004. IECON 2004, Busan, Republic of Korea, 2–6 November 2004; Volume 3, pp. 2552–2555. [Google Scholar] [CrossRef]
- Peserico, G.; Morato, A.; Tramarin, F.; Vitturi, S. Functional Safety Networks and Protocols in the Industrial Internet of Things Era. Sensors 2021, 21, 6073. [Google Scholar] [CrossRef]
- Biegacki, S.; VanGompel, D. The application of DeviceNet in process control. ISA Trans. 1996, 35, 169–176. [Google Scholar] [CrossRef]
- Hartley, Z.K.J.; Lind, R.J.; Pound, M.P.; French, A.P. Domain Targeted Synthetic Plant Style Transfer using Stable Diffusion, LoRA and ControlNet. In Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), Seattle, WA, USA, 17–18 June 2024; pp. 5375–5383. [Google Scholar] [CrossRef]
- Huang, X.; Li, J. The Application of LonWorks in the Building Air Conditioner Intelligent Control System. In Proceedings of the 2012 4th International Conference on Intelligent Human-Machine Systems and Cybernetics, Nanchang, China, 26–27 August 2012; pp. 205–207. [Google Scholar] [CrossRef]
- Yue, G. Design of Intelligent Monitoring and Control System Based on Modbus. In Proceedings of the 2020 5th International Conference on Communication, Image and Signal Processing (CCISP), Chengdu, China, 13–15 November 2020; pp. 149–153. [Google Scholar] [CrossRef]
- Siddavatam, I.A.; Parekh, S.; Shah, T.; Kazi, F. Testing and validation of Modbus/TCP protocol for secure SCADA communication In CPS using formal methods. Scalable Comput. Pract. Exp. 2017, 18, 313–330. [Google Scholar] [CrossRef]
- Elamanov, S.; Son, H.; Flynn, B.; Ki Yoo, S.; Dilshad, N.; Song, J.S. Interworking between Modbus and internet of things platform for industrial services. Digit. Commun. Netw. 2022, 10, 461–471. [Google Scholar] [CrossRef]
- Ergan, A.F.; Sarıoğlu, K. Design and Application of a Novel Dimmable Lighting Control Unit with Active Power Measurement via KNX Protocol. In Proceedings of the 2021 13th International Conference on Electrical and Electronics Engineering (ELECO), Bursa, Turkey, 25–27 November 2021; pp. 555–559. [Google Scholar] [CrossRef]
- Wang, S.; Ouyang, J.; Li, D.; Liu, C. An Integrated Industrial Ethernet Solution for the Implementation of Smart Factory. IEEE Access 2017, 5, 25455–25462. [Google Scholar] [CrossRef]
- Nguyen, T.; Huynh, T. Design and implementation of modbus slave based on ARM platform and FreeRTOS environment. In Proceedings of the International Conference on Advanced Technologies for Communications (ATC), Ho Chi Minh City, Vietnam, 14–16 October 2015; pp. 462–467. [Google Scholar]
- Daniel Flow Products, Modbus Communications Model 2500, Part Number: 3-9000-545 Revision D. November 1992. Available online: www.emerson.com/documents/automation/daniel-modbus-communications-model-2500-manual-en-43890.pdf (accessed on 22 July 2024).
- Modbus Application Protocol Specification, V1.1b, Modbus-IDA. 2006. Available online: www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf (accessed on 22 July 2022).
- 32F746GDISCOVERY: Discovery kit with STM32F746NG MCU, DB2582-Rev 3-December 2019. Available online: https://www.st.com (accessed on 20 July 2024).
- Katulić, F.; Sumina, D.; Groš, S.; Erceg, I. Protecting Modbus/TCP-Based Industrial Automation and Control Systems Using Message Authentication Codes. IEEE Access 2023, 11, 47007–47023. [Google Scholar] [CrossRef]
- Felser, M. Real-time Ethernet—Industry prospective. Proc. IEEE 2005, 93, 1118–1129. [Google Scholar] [CrossRef]
- Modbus Scattered Holding Register Read Function. Available online: https://www.se.com/in/en/faqs/FAQ000241252/ (accessed on 2 October 2024).
- Li, X.; Li, D.; Wan, J.; Vasilakos, A.V.; Lai, C.F.; Wang, S. A review of industrial wireless networks in the context of Industry 4.0. Wireless Netw. 2017, 23, 23–41. [Google Scholar] [CrossRef]
- Ventuneac, C.; Gaitan, V.G. Industrial Internet of Things Gateway with OPC UA Based on Sitara AM335X with ModbusE Acquisition Cycle Performance Analysis. Sensors 2024, 24, 2072. [Google Scholar] [CrossRef]
Modbus RTU Experiment | Initial Moment of Time | Final Measured Time Moment | Time Period Measured |
---|---|---|---|
Acquisition cycle sample (tAC) (Figure 9) | 1.504 s | 5.402 s | 3.898 s |
9.110 s | 5.402 s | 3.708 s | |
9.110 s | 12.760 s | 3.654 s | |
16.390 s | 12.760 s | 3.627 s | |
23.940 s | 20.210 s | 3.735 s | |
35.490 s | 31.650 s | 3.844 s | |
35.490 s | 39.420 s | 3.926 s | |
50.680 s | 46.940 s | 3.735 s | |
Time between two consecutive readings (different registers) of the client (Figure 10a) | 33.09684 s | 33.17495 s | 78.11 ms |
33.25327 s | 33.17495 s | 78.32 ms | |
33.25327 s | 33.37828 s | 125.0 ms | |
30.51304 s | 30.58881 s | 75.77 ms | |
30.36702 s | 30.28912 s | 77.89 ms | |
30.36702 s | 30.44576 s | 78.74 ms | |
30.51304 s | 30.44576 s | 67.28 ms | |
30.67477 s | 30.58881 s | 85.96 ms | |
Period, on RS485 physical medium, of the FC03 read request message (Figure 10b) | 31.3077 s | 31.29959 s | 8.118 ms |
31.46408 s | 31.45596 s | 8.118 ms | |
31.54221 s | 31.53399 s | 8.224 ms | |
31.62046 s | 31.61225 s | 8.211 ms | |
31.69851 s | 31.69028 s | 8.224 ms | |
31.77654 s | 31.76842 s | 8.118 ms |
Modbus RTU Experiment | Initial Moment of Time | Final Measured Time Moment | Time Period Measured |
---|---|---|---|
Processing time at Modbus RTU server level (Figure 11a) | 31.85919 s | 31.85469 s | 4.497 ms |
31.93821 s | 91.93283 s | 5.372 ms | |
32.01621 s | 32.01088 s | 5.333 ms | |
32.09423 s | 32.08913 s | 5.107 ms | |
32.17225 s | 32.16739 s | 4.868 ms | |
32.25025 s | 32.24533 s | 4.921 ms | |
Modbus RTU server response message duration (Figure 11b) | 32.33546 s | 32.32827 s | 7.19 ms |
32.41337 s | 32.40627 s | 7.097 ms | |
32.49138 s | 32.48429 s | 7.084 ms | |
32.5705 s | 32.56331 s | 7.19 ms | |
32.64851 s | 32.64132 s | 7.19 ms | |
32.72651 s | 32.71932 s | 7.19 ms | |
Time taken at the client from receiving the response to sending the next query (tAll) (Figure 12a) | 4.706415 s | 4.662401 s | 44.01 ms |
4.833786 s | 4.790408 s | 43.38 ms | |
4.770459 s | 4.726348 s | 44.11 ms | |
4.854161 s | 4.898075 s | 43.91 ms |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Găitan, V.G.; Zagan, I.; Găitan, N.C. Modbus RTU Protocol Timing Evaluation for Scattered Holding Register Read and ModbusE-Related Implementation. Processes 2025, 13, 367. https://doi.org/10.3390/pr13020367
Găitan VG, Zagan I, Găitan NC. Modbus RTU Protocol Timing Evaluation for Scattered Holding Register Read and ModbusE-Related Implementation. Processes. 2025; 13(2):367. https://doi.org/10.3390/pr13020367
Chicago/Turabian StyleGăitan, Vasile Gheorghiță, Ionel Zagan, and Nicoleta Cristina Găitan. 2025. "Modbus RTU Protocol Timing Evaluation for Scattered Holding Register Read and ModbusE-Related Implementation" Processes 13, no. 2: 367. https://doi.org/10.3390/pr13020367
APA StyleGăitan, V. G., Zagan, I., & Găitan, N. C. (2025). Modbus RTU Protocol Timing Evaluation for Scattered Holding Register Read and ModbusE-Related Implementation. Processes, 13(2), 367. https://doi.org/10.3390/pr13020367