Difference between revisions of "Modbus Master"

From ESS-WIKI
Jump to: navigation, search
 
(106 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
 
= Introduction =
 
= Introduction =
  
Line 7: Line 8:
 
<span style="font-size:medium;">Modbus Service is a Windows/Linux system service for WISE Agent to read&nbsp;sensor data from Modbus device or write data into Modbus device. After sensor data are acquired, WISE Agent will upload the data to the WISE-PaaS Cloud.</span>
 
<span style="font-size:medium;">Modbus Service is a Windows/Linux system service for WISE Agent to read&nbsp;sensor data from Modbus device or write data into Modbus device. After sensor data are acquired, WISE Agent will upload the data to the WISE-PaaS Cloud.</span>
  
<br/>
+
&nbsp;
<br/>
+
 
 +
&nbsp;
  
 
= Features =
 
= Features =
Line 16: Line 18:
 
<span style="font-size:medium;">Feature:</span>
 
<span style="font-size:medium;">Feature:</span>
  
*<span style="font-size:medium;">Support connection with multiple Modbus slave.</span>
+
*<span style="font-size:medium;">Support connection with multiple Modbus slave.</span>  
*<span style="font-size:medium;">Support Modbus TCP and Modbus RTU.</span>
+
*<span style="font-size:medium;">Support access both Modbus TCP and RTU in one service.</span>  
*<span style="font-size:medium;">Support individual sensor&nbsp;upload&nbsp;interval.</span>
+
*<span style="font-size:medium;">Support individual&nbsp;read interval by connection.</span>  
*<span style="font-size:medium;">Configurable sensor alias.</span>
+
*<span style="font-size:medium;">Configurable sensor alias.</span>  
*<font size="3">Support byte swap.</font>
+
*<font size="3">Support byte swap.</font>  
*<span style="font-size:medium;">Currently support up-link Modbus&nbsp;data&nbsp;to WISE-PaaS , not support down-link from WISE-PaaS.</span>
+
*<span style="font-size:medium;">Support Modbus Coil, Descrete input, Input register & Holding register data.</span>
 +
*<font size="3">Support maximal 10 links, 5&nbsp;devices for each link, and 10 sensors for each device.</font>
 +
 
 +
= How to =
 +
 
 +
== Login ==
 +
 
 +
Step 1. Launch a web browser (Google Chrome, Microsoft Edge ...) and open iEdge local web '''[http://127.0.0.1:8080 http://127.0.0.1:8080]'''
 +
 
 +
Step 2. Login iEdge local web:
 +
 
 +
Account: '''root'''
 +
 
 +
Password: '''P@ssw0rd'''
 +
 
 +
[[File:Ros2-iedge-plugin-config-01.png|frameless|900x520px|Ros2-iedge-plugin-config-01.png]]
 +
 
 +
&nbsp;
 +
 
 +
== Configuration ==
 +
 
 +
=== How to config Model ===
 +
 
 +
Step 1. Go to "Plug-ins" / Plugin Config to select Modbus-Master Plug-in
 +
 
 +
[[File:Modbus config bQUoHri.png|border|800x480px|Modbus config bQUoHri.png]]
 +
 
 +
Setp 2. From Modbus-Master Configuration, open Model Management tab, click "+" to add new Model.
 +
 
 +
[[File:Modbus config qpMUDCj.png|border|800x480px|modbus_config_qpMUDCj.png]]
 +
 
 +
Setp 3. Input Model name and Description for new Model.
 +
 
 +
[[File:Modbus config XLSJYyn.png|border|800x480px|modbus_config_XLSJYyn.png]]
 +
 
 +
Step 4. Click "+" to add Sensor - Input Sensor Name - Select Address Space, Access mode, Data Type, Data Format and input Address, Data Length, Minimal/Maximal Value for new sensor's attributes. - Input below timing attributes:&nbsp;Period (second) . Delay (ms, range: 0~1000ms)&nbsp; and&nbsp;Retry (range: 0~5)
 +
 
 +
*Click "Save" button to save the new sensor.
 +
 
 +
[[File:Modbus config qsox6hM.png|border|800x480px|modbus_config_qsox6hM.png]]
 +
 
 +
Step 5. Repeat Step 4 to add another sensor.
 +
 
 +
[[File:Modbus config DPdBICk.png|border|800x480px|modbus_config_DPdBICk.png]]
 +
 
 +
Step 6. Click "Save" button to save the new sensors.
 +
 
 +
[[File:Modbus config oXbCCsc.png|border|800x480px|modbus_config_oXbCCsc.png]]
 +
 
 +
Step 5. Click "Save" button to save the new model.
 +
 
 +
[[File:Modbus config kXoLU5M.png|border|800x480px|modbus_config_kXoLU5M.png]]
 +
 
 +
<br/> &nbsp;
 +
 
 +
=== How to config Link ===
 +
 
 +
Step 1. From Modbus-Master Configuration, open Link Management tab, click "+" to add a new Link.
 +
 
 +
[[File:Modbus config Sz3fL8f.png|border|800x480px|modbus_config_Sz3fL8f.png]]
 +
 
 +
Step 2. Input Link Name, Link Type for the new Link.
 +
 
 +
for Modbus-TCP link, set parameters: - IP - Port
 +
 
 +
for Modbus-RTU link, set parameters: - COM port - Baudrate - Data bits - Stop bits - Parity mode
 +
 
 +
Click "+" icon to add a new device.
 +
 
 +
[[File:Modbus config Dvkgjc2.png|border|800x480px|modbus_config_Dvkgjc2.png]]
 +
 
 +
Step 3. Input Device Name, Station Id and select Model Profile for the new device. Model Profile should be added by upper Model Management steps.
 +
 
 +
Click "Save" button to save the new device.
 +
 
 +
[[File:Modbus config CkZoH3H.png|border|800x480px|modbus_config_CkZoH3H.png]]
 +
 
 +
Step 4. Click "Save" button to save the new link.
 +
 
 +
[[File:Modbus config jGIBhIa.png|border|800x480px|modbus_config_jGIBhIa.png]]
 +
 
 +
Step 5. Click "Apply" button to apply the new link.
 +
 
 +
[[File:Modbus config YudsLa4.png|border|800x480px|modbus_config_YudsLa4.png]]
 +
 
 +
Apply new settings Successfully
  
<br/>
+
[[File:Modbus config 7rvJoo5.png|border|800x480px|modbus_config_7rvJoo5.png]]
<br/>
 
  
= How to =
+
Step 6. Go to Plugin List and select Modbus-Master plugin, the new sensor will be shown in this page
  
== Software Requirements ==
+
[[File:Modbus config Sys1ZZH.png|border|800x480px|modbus_config_Sys1ZZH.png]]
  
*<span style="font-size:medium;">MQTT broker</span>
+
<br/> &nbsp;
*<span style="font-size:medium;">Node.js</span>
 
  
<br/>
+
=== How to import plugin settings ===
  
== Installation ==
+
Step 1. Click Import button from Modbus-Master Configuration
  
<span style="font-size:medium;">'''Windows:'''</span>
+
[[File:Modbus config T6zjSoj.png|border|800x480px|modbus_config_T6zjSoj.png]]
  
<span style="font-size:medium;">1. Download Modbus-Master&nbsp;for Windows from [http://ess-wiki.advantech.com.tw/view/Modbus-Master#Release Release] Table.</span>
+
Step 2. Select target file you like to import
  
<span style="font-size:medium;">2. Double click the&nbsp;installer to launch the installer to install it to the machine.</span>
+
[[File:Modbus config ZYeZTw5.png|border|800x480px|modbus_config_ZYeZTw5.png]]
  
<br/>
+
Import successful
  
<span style="font-size:medium;">'''Linux:'''</span>
+
[[File:Modbus config k3N8BQO.png|border|800x480px|modbus_config_k3N8BQO.png]]
  
<span style="font-size:medium;">N.A.</span>
+
Step 3. Click APPLY to use imported configuration
  
<br/>
+
[[File:Modbus config JTgo9CB.png|border|800x480px|modbus_config_JTgo9CB.png]]
<br/>
 
  
== Configuration ==
+
Apply new settings Successfully
  
<span style="font-size:medium;">EdgeSense Modbus Master can manage multiple Modbus Slave setting and individual sensor's parameters, below settings are default after Modbus Master installation.</span>
+
[[File:Modbus config WZGsmXR.png|border|800x480px|modbus_config_WZGsmXR.png]]
  
 +
<br/> &nbsp;
  
 +
=== How to export plugin settings ===
  
<span style="font-size:medium;">1. Device Configuration: &lt;Install_folder&gt;\config\industry\device-industry.yaml</span>
+
Step 1. Click Export button from Modbus-Master Configuration
<pre>metadata:
 
  name: "Modbus devices"
 
  labels: ["Modbus"]
 
  Description: "Modbus TCP/RTU devices with 3 sensors in holding register area 40001~40003"
 
  UpdateData: 2020-01-08-14:25:30
 
  
# DeviceInfo: You can add a new device with unique name
+
[[File:Modbus config tH3zFyI.png|border|800x480px|modbus_config_tH3zFyI.png]]
# <DeviceName>: Unique Device Name
 
  # Params:
 
  
LinkInfo:
+
Step 2. Explore the exported file
  COM1:
 
    Params:
 
      Driver: Modbus-RTU
 
      ConnectType: Serial
 
      PortName: COM1
 
      BaudRate: 9600
 
      DataBits: 8
 
      StopBits: 1
 
      Parity: None
 
   
 
    Info:
 
      PollingInterval: 1000  # Polling interval ( milliseconds )
 
      Timeout: 100          # A request timeout ( milliseconds )
 
      Retry: 3              # Retries min:0 max:3 ( count )
 
      AliveTime: 60          # Link Timeout in second: SDK will release this link if there are any request over this AliveTime ( second )
 
      CheckLinkInterval: 5  # Check link status interval (second)
 
  
    DevList:  
+
[[File:Modbus config IU83MxX.png|border|800x480px|modbus_config_IU83MxX.png]]
      - Device-1
 
  
  TCP-IP-1:
+
<br/> &nbsp;
    Params:
 
      Driver: Modbus-TCP
 
      ConnectType: Net
 
      IP: 127.0.0.1
 
      Port: 502
 
 
 
    Info:
 
      PollingInterval: 1000  # Polling interval in milliseconds
 
      Timeout: 100          # A request timeout in milliseconds
 
      Retry: 3              # Count of retry min:0 max:3 
 
      AliveTime: 60          # Link Timeout in second: SDK will release this link if there are any request over this AliveTime ( second )
 
      CheckLinkInterval: 5  # Check link status interval (second)
 
  
    DevList:
+
== Use case ==
      - Device-2
 
  
 +
=== Connect and upload data for Modbus Temperature and Humidity sensor ===
  
DeviceInfo:
+
Use Modsim32 to simulate a modbus TCP device with a temperature sensor and a humidity sensor, config Modbus-Master to read these two sensors and upload iEdge cloud.
Device-1:
 
  Params:
 
    Station: 1
 
  
  Profile: MODBUS_DEVICE_01.yaml
+
&nbsp;
  
Device-2:
+
&nbsp;
  Params:
 
    Station: 2
 
  
  Profile: MODBUS_DEVICE_02.yaml
+
==== Config Modbus simulator ====
  
 +
Step1. Open Modbus Simulator: Launch ModSim32 and click "New" in program menu to create a new simulator page.
  
</pre>
+
[[File:Modbus config GskBtAL.png|800x480px|Modbus config GskBtAL.png]]
  
 +
Step2. Set parameter as below:
  
 +
*Device Id: '''1'''
 +
*Address: '''0001'''
 +
*Length: '''2'''
 +
*Modbus Point Type: '''INPUT REGISTER'''
  
<span style="font-size:medium;">2. Sensor&nbsp;Configuration for Device-1: &lt;Install_folder&gt;\config\industry\Profile\MODBUS_DEVICE_01.yaml</span>
+
[[File:Modbus config wVMbXWs.png|800x480px|Modbus config wVMbXWs.png]]
<pre>metadata:
 
  name: MODBUS_DEVICE_01.yaml
 
  labels: ["MODBUS"]  
 
  Description: This profile is for Modbus device 01
 
  version: 1.0.1
 
  UpdateData: 2020-01-08-14:25:30
 
  
Sensor:
+
Step3. Enable Auto Simulation:
  Temperature:
 
    Params:
 
      Address: 0  # Address
 
      Length: 1 
 
      DataType: int16
 
      DataFormat: ABCD
 
  
    Info:
+
*Double click on the sensor address 30001
      v: -1
+
*Click "Auto Simulation"  
      asm: r # Access Right: r, w, rw
 
      min: -10 # Minimum Value
 
      max: 100 # Maximum Value
 
      u: "celsius" # Unit
 
  
  Humidity:
+
[[File:Modbus config PaxcEE3.png|320x200px|Modbus config PaxcEE3.png]]
    Params:
 
      Address: 1
 
      Length: 1 
 
      DataType: int16
 
      DataFormat: ABCD
 
  
    Info:
+
Step4. Set simulation parameters:
      v: -1
 
      asm: r # Access Right: r, w, rw
 
      min: -100 # Minimum Value
 
      max: 100 # Maximum Value
 
      u: "percent"  # Unit
 
  
</pre>
+
*Check "Enable"
 +
*Simulation Type: Increment
 +
*Change Interval (secs): 5
 +
*Step VAlue: 1
 +
*Low Limit: 10
 +
*High Limit: 20
  
 +
[[File:Modbus config maLqhtS.png|600x320px|Modbus config maLqhtS.png]]
  
 +
Step5. Do the same step for the address 30002 and set simulation parameter as below:
  
<span style="font-size:medium;">2. Sensor&nbsp;Configuration for Device-2: &lt;Install_folder&gt;\config\industry\Profile\MODBUS_DEVICE_02.yaml</span>
+
*Simulation Type: Decrement
<pre>
+
*Change Interval (secs): 5
metadata:  
+
*Step VAlue: 1
  name: MODBUS_DEVICE_02.yaml
+
*Low Limit: 60
  labels: ["MODBUS"]
+
*High Limit: 80
  Description: This profile is for Modbus device 02
 
  version: 1.0.1
 
  UpdateData: 2020-01-08-14:25:30
 
  
Sensor:
+
[[File:Modbus config K98RWgN.png|600x320px|Modbus config K98RWgN.png]]
  X-Axis:
 
    Params:
 
      Address: 0  # Address
 
      Length: 1 
 
      DataType: int16
 
      DataFormat: ABCD
 
  
    Info:
+
Step6. Set Connection to Modbus/TCP Svr:
      v: -1
 
      asm: r # Access Right: r, w, rw
 
      min: -10 # Minimum Value
 
      max: 100 # Maximum Value
 
      u: "mm"  # Unit
 
  
  Y-Axis:
+
*Click Connection
    Params:
+
*Click Modbus/TCP Svr to simulate Modbus TCP connection
      Address: 1
 
      Length: 1 
 
      DataType: int16
 
      DataFormat: ABCD
 
  
    Info:
+
[[File:Modbus config ZhpooZd.png|800x480px|Modbus config ZhpooZd.png]]
      v: -1
 
      asm: r # Access Right: r, w, rw
 
      min: -100 # Minimum Value
 
      max: 100 # Maximum Value
 
      u: "mm"  # Unit
 
  
</pre>
+
Step7. Config Modbus-Master
  
= Demonstration =
+
*Config Modbus-Master plugin as upper steps to complete the settings.
  
<br/>
+
&nbsp; &nbsp;
<br/>
 

Latest revision as of 05:24, 8 August 2023

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 data are acquired, WISE Agent will upload the data to the WISE-PaaS Cloud.

 

 

Features

EdgeSense Modbus-Master aims to collect data from Modbus Slave.

Feature:

  • Support connection with multiple Modbus slave.
  • Support access both Modbus TCP and RTU in one service.
  • Support individual read interval by connection.
  • Configurable sensor alias.
  • Support byte swap.
  • Support Modbus Coil, Descrete input, Input register & Holding register data.
  • Support maximal 10 links, 5 devices for each link, and 10 sensors for each device.

How to

Login

Step 1. Launch a web browser (Google Chrome, Microsoft Edge ...) and open iEdge local web http://127.0.0.1:8080

Step 2. Login iEdge local web:

Account: root

Password: P@ssw0rd

Ros2-iedge-plugin-config-01.png

 

Configuration

How to config Model

Step 1. Go to "Plug-ins" / Plugin Config to select Modbus-Master Plug-in

Modbus config bQUoHri.png

Setp 2. From Modbus-Master Configuration, open Model Management tab, click "+" to add new Model.

modbus_config_qpMUDCj.png

Setp 3. Input Model name and Description for new Model.

modbus_config_XLSJYyn.png

Step 4. Click "+" to add Sensor - Input Sensor Name - Select Address Space, Access mode, Data Type, Data Format and input Address, Data Length, Minimal/Maximal Value for new sensor's attributes. - Input below timing attributes: Period (second) . Delay (ms, range: 0~1000ms)  and Retry (range: 0~5)

  • Click "Save" button to save the new sensor.

modbus_config_qsox6hM.png

Step 5. Repeat Step 4 to add another sensor.

modbus_config_DPdBICk.png

Step 6. Click "Save" button to save the new sensors.

modbus_config_oXbCCsc.png

Step 5. Click "Save" button to save the new model.

modbus_config_kXoLU5M.png


 

How to config Link

Step 1. From Modbus-Master Configuration, open Link Management tab, click "+" to add a new Link.

modbus_config_Sz3fL8f.png

Step 2. Input Link Name, Link Type for the new Link.

for Modbus-TCP link, set parameters: - IP - Port

for Modbus-RTU link, set parameters: - COM port - Baudrate - Data bits - Stop bits - Parity mode

Click "+" icon to add a new device.

modbus_config_Dvkgjc2.png

Step 3. Input Device Name, Station Id and select Model Profile for the new device. Model Profile should be added by upper Model Management steps.

Click "Save" button to save the new device.

modbus_config_CkZoH3H.png

Step 4. Click "Save" button to save the new link.

modbus_config_jGIBhIa.png

Step 5. Click "Apply" button to apply the new link.

modbus_config_YudsLa4.png

Apply new settings Successfully

modbus_config_7rvJoo5.png

Step 6. Go to Plugin List and select Modbus-Master plugin, the new sensor will be shown in this page

modbus_config_Sys1ZZH.png


 

How to import plugin settings

Step 1. Click Import button from Modbus-Master Configuration

modbus_config_T6zjSoj.png

Step 2. Select target file you like to import

modbus_config_ZYeZTw5.png

Import successful

modbus_config_k3N8BQO.png

Step 3. Click APPLY to use imported configuration

modbus_config_JTgo9CB.png

Apply new settings Successfully

modbus_config_WZGsmXR.png


 

How to export plugin settings

Step 1. Click Export button from Modbus-Master Configuration

modbus_config_tH3zFyI.png

Step 2. Explore the exported file

modbus_config_IU83MxX.png


 

Use case

Connect and upload data for Modbus Temperature and Humidity sensor

Use Modsim32 to simulate a modbus TCP device with a temperature sensor and a humidity sensor, config Modbus-Master to read these two sensors and upload iEdge cloud.

 

 

Config Modbus simulator

Step1. Open Modbus Simulator: Launch ModSim32 and click "New" in program menu to create a new simulator page.

Modbus config GskBtAL.png

Step2. Set parameter as below:

  • Device Id: 1
  • Address: 0001
  • Length: 2
  • Modbus Point Type: INPUT REGISTER

Modbus config wVMbXWs.png

Step3. Enable Auto Simulation:

  • Double click on the sensor address 30001
  • Click "Auto Simulation"

Modbus config PaxcEE3.png

Step4. Set simulation parameters:

  • Check "Enable"
  • Simulation Type: Increment
  • Change Interval (secs): 5
  • Step VAlue: 1
  • Low Limit: 10
  • High Limit: 20

Modbus config maLqhtS.png

Step5. Do the same step for the address 30002 and set simulation parameter as below:

  • Simulation Type: Decrement
  • Change Interval (secs): 5
  • Step VAlue: 1
  • Low Limit: 60
  • High Limit: 80

Modbus config K98RWgN.png

Step6. Set Connection to Modbus/TCP Svr:

  • Click Connection
  • Click Modbus/TCP Svr to simulate Modbus TCP connection

Modbus config ZhpooZd.png

Step7. Config Modbus-Master

  • Config Modbus-Master plugin as upper steps to complete the settings.