Changes

Created page with "==Summary== RUT955 has a functionality that allows to forward data from Modbus TCP to Modbus RTU. To transfer data from Modbus TCP to Modbus RTU, the RUT955 should be set up..."
==Summary==

RUT955 has a functionality that allows to forward data from Modbus TCP to Modbus RTU. To transfer data from Modbus TCP to Modbus RTU, the RUT955 should be set up as a Modbus gateway.

Modbus RTU means that the Modbus protocol is used on top of a serial RS232 or RS485 interface connection, meanwhile Modbus TCP is used over the internet. In this configuration example we will show you how to transmit data between these connections. To understand better, here is connection topology:

topology.png

==Configuring the router==

Follow these steps to set up the Modbus gateway:

* Navigate to '''Services -> RS232''' or '''RS485''' (depending on your serial interface choice).
* In the configuration section, press '''Enable''' to enable the serial interface.
* In the Serial '''Type''' section, select '''Modbus gateway'''.

[[File:Navigateandenable.png|border|class=tlt-border]]

This will expand more customization options:

* '''Listening IP''' – IP interface on which you are listening for incoming connections.
* '''Port''' – Port number for Modbus gateway (default port is 502).
* '''Slave ID''' configuration type – User defined or obtained from TCP.
* '''Slave ID''' – preconfigured Slave ID number.

[[File:Moreconfigurationoptions.png|border|class=tlt-border]]

After finishing the configuration, press '''Save & Apply'''. With a setup like this, you will be able to send data from Modbus TCP to Modbus RTU.

==TCP and RTU application setup==

To test out this functionality you can use two PCs: one running a Modbus Master simulator and the other running a Modbus PLC simulator, acting as a Modbus slave. Follow these steps to configure this testing scenario:

* Connect PC1 to RUT955 RS232 port.
* Connect PC2 to RUT955 Ethernet LAN port.

'''Modbus RTU setup:'''

* On PC1, run the '''QModMaster''' application.
* Select Modbus Mode: RTU.

[[File:ModeRTU.png|border|class=tlt-border]]

* Navigate to '''Commands -> Connect'''.

[[File:ConnectbuttonRTU.png|border|class=tlt-border]]

* To change the COM port on which the device is connected, navigate to '''Options -> Modbus RTU'''. Set the '''Baud''' rate to be the same as in the RUT955 serial settings.

[[File:Baudandport.png|border|class=tlt-border]]

After completing these steps, the Modbus RTU configuration is finished.
----

* On the PC2, run the ModRSsim2 application.
* In the '''Prot:''' section select '''Modbus TCP/IP'''.

[[File:Tcpsettings1.png|border|class=tlt-border]]

* In the menu in the top right corner, select '''Setup communication Serial or TCP/IP port'''.

[[File:Tcpicon1.png|border|class=tlt-border]]

* Enter the same port number as in the RUT955 Modbus gateway setup (default port is 502).

[[File:Portnumbertcp1.png|border|class=tlt-border]]

With that, the Modbus TCP configuration is finished.

==Testing the configuration==

To test the configuration, we could try to change some values in the Modbus PLC simulator and then try to read them via Modbus Master application.

Navigation menu