Issue
Details on how Modbus IP Multiple Queries and Multiple Query Packets work
Product Line
EcoStruxure Building Operation
Environment
- Building Operation SmartX Servers
- Modbus IP
Cause
Understanding of how the Modbus synchronous and asynchronous transport layers differ.
Resolution
By default, the Multiple queries is Disabled, this is the synchronous transport layer. To enable the asynchronous transport layer the Multiple queries must be Enabled within the Modbus TCP Network properties as shown below.
Setting to "Enabled" allows multiple queries (packets) to be sent to multiple Modbus devices, thus reducing wait times. It also enables further settings in the Modbus Device properties "Maximum concurrent queries" and "Multi-query packets".
The maximum concurrent queries and multiple-query packets as shown below are configurations for the Modbus asynchronous transport layer.
The Maximum concurrent queries setting is only enabled if the "Multiple queries" is enabled in the Network Properties. When enabled, this allows the "concurrent queries" to be sent as a single packet.
Modbus Synchronous Transport Layer
Each Modbus query is sent out one after the other. Before sending out the next query the transport layer waits for a specified period for the previous query.
Example Poll Sequence
Device No. | Objects |
1 | 2 |
2 | 1 |
D=Device, Q=Query, R=Reply
D1 Q1 | Send |
D1 R1 | Receive |
D2 Q1 | Send |
D2 R1 | Receive |
D1 Q2 | Send |
D1 R2 | Receive |
If it takes 1 second for the device to reply, then this sequence would take 3 seconds.
Modbus Asynchronous Transport Layer
With the asynchronous transport layer enabled, the queries are transmitted to multiple devices at the same time. The maximum number of queries that are transmitted to that one device is controlled by the “Maximum concurrent queries” setting. The “Multiple-query packet” specifies whether the queries are transmitted in one TCP frame or not.
Simple Example Poll Sequence
Device No. | Objects | Multiple-query packet | Maximum concurrent queries |
1 | 2 | False | 1 |
2 | 1 | False | 1 |
D=Device, Q=Query, R=Reply
D1 Q1 | Send |
D2 Q1 | Send |
D1 Q2 | Send |
D1 R1 | Receive |
D2 R1 | Receive |
D1 R2 | Receive |
If it takes 1 second for the device to reply, then this sequence would take 1 second
Complex Example Poll Sequence
Device No. | Objects | Multiple-query packet | Maximum concurrent queries |
1 | 10 | True | 5 |
2 | 4 | False | 2 |
D=Device, Q=Query, R=Reply
D1 Q1, Q2, Q3, Q4, Q5 | Send |
D2 Q1 | Send |
D2 Q2 | Send |
D1 R1, R2, R3, R4, R5 | Receive |
D2 R1 | Receive |
D2 R2 | Receive |
D1 Q6, Q7, Q8, Q9, Q10 | Send |
D2 Q3 | Send |
D2 Q4 | Send |
D1 R6, R7, R8, R9, R10 | Receive |
D2 R1 | Receive |
D2 R2 | Receive |
If it takes 1 second for the device to reply, then this sequence would take 2 seconds
NOTES
- The use of this feature should be avoided before EBO v3.1, there is also a defect in EBO v3.2 that means v3.2.3.5000 should be used (minimum)
- Some Modbus devices do not support multiple queries or multiple query packets, so the feature should be tested on an individual basis. (Some devices may even go offline until manually reset)
- This feature will increase the CPU usage on the EBO server. It should be avoided on EBO Servers that are already heavily loaded
- This feature also has the ability to reduce the system stability, it is usually better to optimize the use of Modbus Register Groups to increase performance