Modbus RTU Network Simulation
Modbus RTU Network Simulation

In today's practice, we are going to simulate a Modbus RTU point-to-point network, as it will be point-to-point, and its topology would be like the attached image. This will serve as an introduction for the next practice where we will use an S7-200 as a Modbus slave and check that it is properly configured.
We will use the following software: a COM port simulator, which you can download here, and to simulate the Modbus Master/Slave, we will use Modbus Poll / Modbus Slave, which you can download here.
Once downloaded, we will configure the Virtual Serial Ports. When starting it, this is the interface; we right-click and create.

The wizard for the type of configuration we want will open; in this case, we will use Pair, as observed. Next, we specify two serial ports, in this case, COM3-COM4, which are virtual.


Once finished, it can be observed that it is running and functioning correctly.

The next step is to run Modbus Poll, which will be our virtual Master. We specify that the connection is serial and from the two serial ports created earlier, we assign one, with the parameters of a serial port, speed, parity, etc... IMPORTANT, these data must match in the Slave.
We define an area of Registers that we want to access for reading/writing.


We run Modbus Slave, specify that the connection is serial, with the same parameters that we had defined earlier, and in the Setup -> Slave Definition, we define the area of registers that interests us, which must match what we defined in Modbus Poll and the slave number.

Once both are configured, the connection is established correctly; if there were no connection, we would have an error message. We can now read and write in the registers.

Now, if we want to write to a register, we double-click, and a window appears where we define the value and the address. When we click Send, the update is shown in the Slave and Response OK in Modbus Poll.

On the other hand, if we want to do it vice versa, writing in the Slave, we double-click and define the value, and then Modbus Poll updates.


With this, we have simulated our virtual network, which can be useful when we want to simulate a Slave, or conversely, when we want to simulate a Master (Poll).