Modbus Block Data Collection for Reduced Bus Occupation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Modbus protocol's limited data field length results in inefficient data collection, leading to frequent bus occupation and reduced real-time performance due to multiple requests and responses for large data sets, with a maximum of 252 bytes per packet.
Innovation Solution
Implement a data collection method that allows for block data collection, where each block can contain up to 256 bytes, and extends the Modbus packet to include block collection indication information and frame sequence numbers for reliability, enabling one-time interactions with multiple slaves to reduce bus occupation and improve efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If the Modbus protocol uses multiple requests and responses to collect large amounts of data, then the data collection completeness is improved, but the bus occupation frequency increases and real-time performance deteriorates
Solution Approach 1:
The patent combines multiple data collection requests into a single Modbus packet by extending the data field to carry multiple blocks of indication information. Each block contains address and length parameters for different data regions, allowing the master device to collect data from multiple slaves simultaneously in one bus occupation, thereby improving real-time performance while maintaining complete data collection.
2Adaptability or versatility
If the Modbus packet data field length is limited to 252 bytes, then the protocol compatibility is improved, but the data transfer efficiency deteriorates
Solution Approach 1:
The patent segments the data field into multiple blocks, where each block contains indication information for a specific data region (address and length parameters). This segmentation allows the extended data field to carry information for collecting more than 252 bytes of data while maintaining compatibility with the original Modbus protocol structure, thus improving data transfer efficiency without sacrificing protocol compatibility.
3Reliability
If the slave device responds multiple times for data collection, then the data accuracy is improved, but the bus occupation rate decreases
Solution Approach 1:
The patent merges multiple data collection operations into a single bus occupation by including multiple blocks of indication information in one Modbus packet. The slave device processes all blocks and returns corresponding data in one response, maintaining data accuracy through proper error handling while significantly improving the bus occupation rate by eliminating repeated request-response cycles.
Data Source
Figure 1~2
Figure 3
Figure 4
AI summary
Embodiments of this application disclose a data collection method and apparatus, a Modbus system, and a storage medium, and pertain to the field of communication technologies. In embodiments of this application, one or more pieces of block data are collected at one-time interaction between a master and a slave, and a maximum amount of data carried in each piece of block data is 256. In the Modbus system, one piece of data is represented in a minimum of 1 byte, so that the data carried in each piece of block data can be up to 256 bytes. If a plurality of pieces of block data are collected at one-time interaction, an amount of data that can be collected is much larger than 252 bytes limited in a protocol. That is, in this solution, a larger amount of data can be collected at one-time interaction. When an amount of data that needs to be collected is specified, a quantity of times of interaction between the master and the slave can be reduced. In this way, an occupation frequency of a bus decreases but an occupation rate increases. In addition, because more data is responded with by the slave at a time, the master does not spend a long time on one slave. Therefore, real-time performance of the Modbus system is improved.