Frequently Asked Question
Introduction
Modbus RTU is not supported as standalone protocol on Typhoon HIL devices, only Modbus TCP. But, Modbus RTU communication is possible by using external Modbus RTU to TCP converters. One of these external controllers, that is tested and verified, is NET485 Ethernet to RS422/485 adapter for the company gridconnect. (https://www.gridconnect.com/products/net485-mb-modbus-rs485-adapter)
The idea is illustrated on the picture below.
Modbus RTU to TCP converter
There are plenty of Modbus RTU to TCP converters on the market. Typhoon HIL cannot guaranty that one controller is better than the other, but we can recommend the NET485 adapter by gridconnect, simply because we are familiar with this product.
This converter uses RS422/482 serial communication protocol. In case that RS232 serial protocol is needed, the company also provides the NET232 adapter.
Controller setup
In order to configure the controller, you need to connect it to the network and power it up by using 8-24 VDC voltage source.
Once the controller is connected and powered up, you can access it through your Web browser or by using the NET485 DeviceInstaller software that can be downloaded from the product site. We will show the configuration using the Web browser.
When you first connect the controller, it will have dynamic IP address that is not known in advance. You can use your Command Prompt to get the IP address information. Simply open the “cmd” on your windows machine and type in “arp –a” command. The result of the command is shown below.
To identify the controller IP address, search for a Physical Address stating with 00-80-A3 and use this address. In our case it is the address 192.168.0.215.
Once you know the IP address, simply enter that value in your Web browser and it will open the configuration window of your controller device (picture below).
If you are asked to enter the User Name and Password, simply leave the fields empty and press OK.
Network
The Network configuration lets you specify the IP configuration of your controller device. If you select the “Obtain IP address automatically” option, the IP will be dynamically assigned to the controller each time the controller is powered up.
On the other hand, you can specify the static IP address of the controller by selecting the “Use the following IP configuration” option. You just need to be careful that the desired IP address is not already used on the network.
An example of the IP configuration is presented below. Every time the controller is powered up, it will have the IP 192.168.0.33
Server
The Server settings are defined when somebody connects to the controller using Web browser and they are not important in our case.
Modbus Bridge
Modbus Bridge is the most important option in our case. This option defines how the RTU data will be translated to TCP.
Serial Settings
Serial Settings are applied to the RTU part of the communication. You can specify the Baud Rate, Data Bits, Parity and Stop Bits values.
Make sure you select RTU protocol in the Modbus part of the options.
Everything else can be left as default.
Modbus TCP
Modbus TCP settings are applied to the TCP part of the communication.
Make sure you select the “Modbus/TCP Client attached to master” option.
Modbus/TCP Port value must be the same as Port value defined in the Typhoon HIL Schematic Editor model.
Another important setting is “Unit ID to IP Address Mapping”. This setting defines to what TCP server the request will be routed. Unit ID value is defined in the Modbus RTU protocol and it is not used in the Modbus TCP. This value is used to address the correct Slave device. In the Modbus TCP, IP address is used for addressing the correct Slave device.
In most cases, the Address Mapping will be defined as shown below. The start ID is defined as 1 and end ID is defined as 255. The ID values in RTU can go from 1 – 255, so this setup defines that all the requests will be routed to the Server with the IP of 192.168.0.30.
It is important to mention that the IP address defined previously in the Network options, and the IP addresses defined here are not the same thing. The IP address in the Network option is the address of the controller itself and it is used only in the Web browser, to configure the controller. The IP address defined in the Modbus TCP option is the address of the Modbus Server running on the HIL device. This IP address value must be the same as the value defined in the Typhoon HIL Schematic Editor model.
Confirmation
Once you defined all the controller options, click “Apply Settings” and wait until the settings are applied.
Wiring
If the “Interface” value in “Serial Settings” (picture below) is defined as RS485 – 2 wire, the wiring is not that straight forward. To translate from 4-wire to 2-wire, TXDA and RXDA must be sorted, as well as TXDB and RXDB. Shortening those terminals, you will get Data + (D+) and Data – (D-) terminals which you connect to pin 2 and 7, respectively. GND terminal is connected to pin 5.