Products

Following is a list of articles. Click the 'View' button to see the detail of the article.

Return to Article List



In this Tech Tip we will take you through some simple steps to implement protocol conversion from Modbus RTU to Modbus TCP.  An advantage of converting from MODBUS RTU to TCP/IP is that the Modbus data is converted from serial to run on an Ethernet layer, resulting in CRC error-checking.

The below run-through is suitable for several Red Lion devices such as the DA10, DA30, DA50 & DA70 Group 2 and above. In this example, we have used a DA50 Group 3 Red Lion device.

Let’s start…

  • Generate your crimson file and select the appropriate device.

Select your ethernet and serial port drives. An example of the selected drivers can be seen in Figure 1

Figure 1: Network Modbus TCP/IP Driver

Ensure that the ethernet configuration is setup correctly according to specifications. These options can be found under the ethernet port in the navigation window. An example of how this has been setup in this tech tip is shown in Figure 2.

Figure 2: Port Configuration Settings

You will then have to select your drivers that will communicate to the Modbus RTU slave device.

Figure 3: Serial Port Driver Options

Like the Ethernet settings ensure that your serial port settings are matching the requirements of the slave device for Modbus RTU driver.

Figure 4:Serial Port Settings

It may be necessary to disable ping holding registers by setting the value to zero. The Ping holding register value is used to quickly detect if a device is online. The default setting is 1, which means that the Red Lion will read 400001 (function code 03 register 0x00 length of 1) to determine if the device is online.  If the slave device does not have this register set the value to 0.


Figure 5: Protocol Option - Holding Register set to 0

Once the drivers have been selected and configured it is required that the registers are mapped via blocks in crimson. This is done by adding a block, right click on the slave device (able to be renamed) and add block. The starting addresses for this block will then need be assigned, the available Modbus registers are normally provided by manufacturer of the slave devices. The length of the block will dictate how many registers will be mapped to the Red Lion device. This setup procedure is demonstrated in Figure 6. For the example we have only used the digital input registers.  



Figure 6: Modbus Register Mapping

Once you have configured all the registers that will be mapped in the Serial Port, the same will need to be done for the network protocol driver (Modbus TCP/IP Driver). This follows the same steps as above however the direction of data is the main change. This is required to be altered as data is going from the Red Lion device to the system that will handle the data. It will have to be set as displayed in Figure 7.

Figure 7: Modbus TCP/IP Settings and Modbus Registers

Once you click on your TCP/IP register that requires mapping go to the resource pane and expand the device you want (slave RTU device previously made), click and drag the register type or tag over. The mapping will ask for starting address and length unless a tag is being mapped. Enter these values and it should appear as below:

Figure 8: Modbus TCP/IP Register Mapping from Modbus RTU Slave Device

Once you have done this the setup from Modbus RTU to Modbus TCP/IP is complete. The mapping for tags is demonstrated in Figure 9.

Figure 9: Modbus TCP/IP Mapping Example

This section will cover some additional information that can help troubleshoot and testing of the system if you ever experience any issues. To cross-reference and confirm device data mapped into the device tags, a system internal tag can be generated and mapped through the resource pane to the register (method shown above). This block can then be watched through the watch block command in Crimson.

Ensure that the drop number matches your device number on the slave device, the device will not be able to communicate otherwise.

Red Lion serial ports offer two sets of TxA and TxB. This allows pin 1, 2 to be used as well as 7,8 or a combination of the two, this is handy when troubleshooting and testing. Confirm your device serial port connections when wiring the device.

Figure 10: Red Lion RS485 Pin allocation

This section will cover the verification of the steps carried out above. We can simulate the slave device if you do not have one a program called ModSim32. Now that the correct registers have been made the values can be simulated.

Figure 11: Modbus RTU Slave Device Registers

Once we have setup the connections, we can also verify that the unit is producing the correct Modbus TCP/IP registers. ModScan32 can be used for this. All that is required is the device IP address for the ModScan to bind to.

Figure 12: Modbus TCP/IP Verification

When testing and changing the input status the bits can be observed to change. We have now not the only set up Modbus RTU to Modbus TCP/IP conversion but also verified its operation.

And that's it! If you still have questions, or would like more information on Red Lion products or software,  get in touch with us on 1300 556 601.

 
Products to compare:
Comparing Products