Setting up the Modbus RTU Channel (Release 3.3 and Prior)

Setting up the Modbus RTU Channel (Release 3.3 and Prior)

For SmartServer 3.4 and higher, see Setting up the Modbus RTU Channel

This section consists of the following:

Modbus RTU Channel Overview

The SmartServer IoT Starter Kit includes an Advantech ADAM-4150 DIO module. This module includes LEDs that indicate the state of the module’s digital outputs. A pair of switches to the right of the module are connected to inputs DI-0 and DI-1 as shown in the figure below. Two of the wires loop back connecting outputs DO-0 to DI-2, and DO-1 to DI-3. 

Get started setting up the Modbus RTU channel following the steps in the section below: Getting Started with Modbus RTU Channel Setup

Getting Started with Modbus RTU Channel Setup

The ADAM-4150 module initially communicates using Advantech’s proprietary serial protocol. The communication interface can be upgraded to support Modbus RTU using an ADAM 4000/5000 utility and and USB to RS-485 converter. This utility is available for download at https://support.advantech.com/support/DownloadSRDetail_New.aspx?SR_ID=1-9HOC2&Doc_Source=Download.

An easier option leverages the programming support of the SmartServer IoT. A small node.js application is provided to accomplish this task. Follow these steps:

Note: You need to have winscp.exe and putty.exe installed on your PC for this procedure.

  1. Use winscp.exe to create the following folder on the SmartServer IoT (you should be connected with the SmartServer apollo username and password):
    /var/apollo/data/apps/adam-setup


  2. Transfer adam-setup.zip from the Starter Kit archive → Modbus RTU Channel folder to the SmartServer IoT folder that was created in the previous step.


  3. Use PuTTY to connect to the SmartServer SSH console.


  4. Enter the following command: cd /var/apollo/data/apps/adam-setup


  5. Enter the following command: unzip adam-setup.zip


  6. Enter the following command: rm adam-setup.zip


  7. Power down the ADAM-4150 module by unplugging the bottom power supply connector.


  8. Move the configuration switch from the Normal to Init position.




  9. Power up the ADAM-4150 module by plugging in the bottom power supply connector. With the following step, the ADAM-4150 module to setup to use Modbus address 01 and to communicate at 19200 Baud, no parity, and one stop bit.


  10. Enter the following command: node adamConfig.js 01 7

    This command configures the ADAM-4150 module to use a 19200 Baud serial Modbus at address 01. 

    You should see a result similar to the following:






  11. Power down the ADAM-4150 module by unplugging the bottom power supply connector.


  12. Move the configuration switch from the Init to Normal  position. If you neglect to move the switch to the Normal position, the module will not use the Modbus settings that were just programmed.




  13. Power up the ADAM-4150 module by plugging in the bottom power supply connector.

Continue setting up the Modbus RTU channel following the steps in the section below: Setting the RS-485 Configuration UI

Setting the RS-485 Configuration UI

  1. Log into the SmartServer configuration UI using the username and password that appears on the SmartServer IoT.


  2. The Network Configuration page appears.





  3. Click the RS-485 tab.

    The RS-485 Configuration page appears.





  4. Configure your RS-485-1 settings to match those shown in the figure below. When you configured the ADAM-4150 module at Modbus address 01, you also set the serial bit rate it would use to communicate. The above instructions set the baud rate to 19200. The module's serial frame does not use parity and looks for only 1 stop bit.





  5. Click Update.