Modbus Handler v1.0
Contents
Introduction
Modbus enables communication among many devices connected to the same network, for example, a system that measures temperature and humidity and communicates the results to a computer. Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems.
Many of the data types are named from its use in driving relays: a single-bit physical output is called a coil, and a single-bit physical input is called a discrete input or a contact.
Modbus Service is a Windows/Linux system service for WISE Agent to read sensor data from Modbus device or write data into Modbus device. After sensor ata are acquired, WISE Agent will upload the data to the WISE-PaaS Cloud.
Configuration
1. Open File Explorer and change target folder to the RMM Agent installation folder.
2. Open and edit the file \module\module_config.xml to enable Modbus Handler
(by default, the path is C:\Program Files (x86)\Advantech\RMM 3.3 Agent\module\module_config.xml)
<ModuleName17>Modbus_Handler</ModuleName17>
<ModulePath17>\module\Modbus_Handler.dll</ModulePath17>
<ModuleEnable17>TRUE</ModuleEnable17>
3. Open and edit the file Mobus_Handler.ini
(by default, the path is C:\Program Files (x86)\Advantech\RMM 3.3 Agent\Mobus_Handler.ini)
3.1 Give a name for the filed "Name" in the [Platform] session.
3.2 Set the protocol for the field "Protocol" in the [Platform] session, you can config to the type of Modbus_TCP or Modbus_RTU follow below example:
Config for the modbus TCP devices:
Protocol=Modbus_TCP
ClientIP=(IP address of Modbus TCP devices)
ClientPort=(Port of Modbus TCP devices)
Example:
[Platform] Name=WISE-4012E Protocol=Modbus_TCP ClientIP=127.0.0.1 ClientPort=502 UnitID=1 Interval=3 #Interval: The time delay between two modbus access round in second. Delay=0 #Delay: The time delay between two modbus access in millisecond. #Delay=0 means no delay. Log=0
Config for the modbus RTU devices:
Protocol=Modbus_RTU
SlavePort=(The serial port's device node of the Gateway which connect to Modbus RTU devices)
Baud=(The baud rate for the serial port to communicate with Modbus RTU device)
Parity=(The parity of the serial port)
DataBits=(The data bits of the serial port)
StopBits=(The stop bits of the serial port)
Example:
[Platform] Name=EKI-XXXX Protocol=Modbus_RTU SlavePort=COM1 Baud=19200 Parity=None DataBits=8 StopBits=1 SlaveID=1 Interval=3 #Interval: The time delay between two modbus access round in second. Delay=0 #Delay: The time delay between two modbus access in millisecond. #Delay=0 means no delay. Log=0
3.3 Set Modbus bits data and registers.
Example for Coils:
[Coils] numberOfB=3 B0=0,LED0 B1=1,LED1 B2=2,LED2
Example for Discrete Inputs:
[Discrete Inputs] numberOfIB=3 IB0=0,Switch0 IB1=1,Switch1 IB2=2,Switch2
EdgeSense Linux
How to config Modbus Service and Restart Service - Docker version
$cd ${Installed path}/Installer/packages/Plugins/docker-edgesense-image-x86/EdgeSense/EService-Modbus/config $sudo vim Modbus_Handler.ini $sudo docker restart service-modbus
How to install and config Modbus Service - Native application
Install
$tar zxvf Modbus_Handler-1.0.2-Ubuntu_16.04-x86_64.tar.gz $sudo ./Modbus_Handler-1.0.2-Ubuntu_16.04-x86_64.run
Configuration & restart service
$cd /usr/local/EdgeSense/Modbus_Handler $sudo vim Modbus_Handler.ini $sudo systemctl restart Modbus_Handler