5. CONFIGURATION
5.6. Communication Performance
5.6.1. MODBUS Server
The MODBUS devices configurable in the Nexto CPU run in the background, with a priority below the user application
and cyclically. Thus, their performance varies depending on the remaining time, taking into account the difference between the
interval and time that the application takes to run. For example, a MODBUS device in an application that runs every 100 ms,
with a running time of 50 ms, will have a lower performance than an application running every 50 ms to 200 ms of interval.
It happens because in the latter case, the CPU will have a longer time between each MainTask cycle to perform the tasks with
lower priority.
It also has to be taken into account the number of cycles that the device, slave or server takes to respond to a request.
To process and transmit a response, a MODBUS RTU Slave will takes cycles (cycle time of the MODBUS task), whereas a
MODBUS Ethernet Server task takes only one cycle. But this is the minimum time between receipt of a request and the reply.
If the request is sent immediately after the execution of a task MODBUS cycle time may be equal to 2 or 3 times the cycle
time for the MODBUS slave and from 1 to 2 times the cycle time for the MODBUS server.
In this case: Maximum Response Time = 3 * (cycle time) + (time of execution of the tasks) + (time interframe chars) +
(send delay).
For example, for a MODBUS Ethernet Server task with a cycle of 50 ms, an application that runs for 60 ms every 100 ms,
the server is able to run only one cycle between each cycle of the application. On the other hand, using the same application,
running for 60 ms, but with an interval of 500 ms, the MODBUS performs better, because while the application is not running,
it will be running every 50 ms and only each cycle of MainTask it will take longer to run. For these cases, the worst performance
will be the sum of the Execution Time of the user application with the cycle time of the MODBUS task.
For the master and client devices the operating principle is exactly the same, but taking into account the polling time of the
MODBUS relation and not the cycle time of the MODBUS task. For these cases, the worst performance of a relationship will
be performed after the polling time, along with the user application Execution Time.
It is important to stress that the running MODBUS devices number also changes its performance. In an user application
with Execution Time of 60 ms and interval of 100 ms, there are 40 ms left for the CPU to perform all tasks of lower priority.
Therefore, a CPU with only one MODBUS Ethernet Server will have a higher performance than a CPU that uses four of these
devices.
5.6.1.1. CPU’s Local Interfaces
For a device MODBUS Ethernet Server, we can assert that the device is capable to answer a x number of requisitions per
second. Or, in other words, the Server is able to transfer n bytes per second, depending on the size of each requisition. As
smaller is the cycle time of the MODBUS Server task, higher is the impact of the number of connections in his answer rate.
However, for cycle times smaller than 20 ms this impact is not linear and the table below must be viewed for information.
The table below exemplifies the number of requisitions that a MODBUS Server inserted in a local Ethernet interface is
capable to answer, according to the cycle time configured for the MODBUS task and the number of active connections:
Number of Active Connections
Answered requisitions
per second with the
MODBUS task cycle at
5 ms
Answered requisitions
per second with the
MODBUS task cycle at
10 ms
Answered requisitions
per second with the
MODBUS task cycle at
20 ms
1 Connection 185 99 50
2 Connections 367 197 100
4 Connections 760 395 200
7 Connections 1354 695 350
10 Connections 1933 976 500
Table 152: Communication Rate of a MODBUS Server at Local Interface
ATTENTION
The communication performances mentioned in this section are just examples, using a CPU
with only one device MODBUS TCP Server, with no logic to be executed inside the appli-
cation that could delay the communication. Therefore, these performances must be taken as
the maximum rates.
213