KGW3102 Modbus Gateway User Manual

KGW3102 Modbus Gateway
User Manual
1st Edition, August 2017
www.kyland.com
KGW3102 Modbus Gateway
User Manual
The software described in the manual is furnished under a license agreement and may be used only in
accordance with the terms of that agreement.
Copyright Notice
Kyland Technology Co., Ltd. All rights reserved.
Trademarks
The Kyland logo is a registered trademark of Kyland Technology Co., Ltd.
All other trademarks or registered marks in this manual belong to their respective manufacturers.
Disclaimer
The information provided in this manual is intended to be accurate and reliable. However, Kyland can not
guarantee that there is not any error including the technical error or the typographical error. Kyland reserves
the only right to modify the describitondescription of products and programs in the manual without notice to the
users. Anyone is not to be allowed to copy, reproduce and business use.
Please note the infringement. Copyright © 2017 Kyland Technology Co., Ltd.
Technical Support Contact Information
www.kyland.com/support
Kyland China
Tel: +86-10-88796676
Fax: +86-10-88796678
Kyland EMEA
Tel: +49 (0) 711 997606-200
Fax: +49 (0) 711 997606-211
Kyland India & SEA
Tel: +91-9008358660
Kyland Americas
Tel: +1-303-447-6882
Kyland Asia Pacific
Tel: +65 3157 9226
Table of Contents
1. Introduction ............................................................................................................................................................ 1
1.1 Overview .................................................................................................................................................................... 2
1.2 Package Checklist .................................................................................................................................................... 2
1.3 Product Features ...................................................................................................................................................... 2
2. Getting Started ...................................................................................................................................................... 3
2.1 Connecting Power .................................................................................................................................................... 4
2.2 Connecting Serial Devices ...................................................................................................................................... 4
2.2.1 Setting RS-485 Terminal Resistors ................................................................................................................ 4
2.2.2 Connecting to a Host or the Network ............................................................................................................. 4
2.3 LED Indicators ........................................................................................................................................................... 5
2.4 Dimension Figures.................................................................................................................................................... 6
2.5 Pin Assignments ....................................................................................................................................................... 6
2.5.1 Ethernet Ports (RJ45) ....................................................................................................................................... 6
2.5.2 Serial Ports (DB9 Male) ................................................................................................................................. 76
2.5.3 Power Input Ports .............................................................................................................................................. 7
2.6 Specifications .......................................................................................................................................................... 87
3. Typical Applications........................................................................................................................................... 10
3.1 Ethernet Masters with Multiple Serial Slaves ..................................................................................................... 11
3.2 Serial Masters with Multiple Ethernet Slaves ..................................................................................................... 12
4. Web Console Configuration ............................................................................................................................. 14
4.1 Log In........................................................................................................................................................................ 15
4.2 Device Information.................................................................................................................................................. 15
4.3 Network Settings ..................................................................................................................................................... 15
4.4 Operating Settings .................................................................................................................................................. 16
4.4.1 Operation Mode Settings ............................................................................................................................... 16
4.4.2 Transparent Mode ........................................................................................................................................... 16
4.4.3 Agent Mode ...................................................................................................................................................... 18
4.5 Serial Settings ......................................................................................................................................................... 20
4.6 Agent Settings (Agent Mode) ................................................................................................................................ 20
4.6.1 Gateway Settings ............................................................................................................................................ 21
4.6.2 Slave List .......................................................................................................................................................... 21
4.6.3 Data Query ....................................................................................................................................................... 23
4.7 Import/Export ........................................................................................................................................................... 24
4.8 Upgrade Firmware .................................................................................................................................................. 24
4.9 Change Password .................................................................................................................................................. 24
4.10 Load Factory Default ............................................................................................................................................ 25
4.11 Save/Reboot ......................................................................................................................................................... 25
4.12 Help ........................................................................................................................................................................ 25
4.13 Logout .................................................................................................................................................................... 25
5. Case Studies ........................................................................................................................................................ 26
5.1 Transparent-A ......................................................................................................................................................... 27
5.2 Transparent-B ......................................................................................................................................................... 29
5.3 Agent-A .................................................................................................................................................................... 32
5.4 Agent-B .................................................................................................................................................................... 35
1. Introduction
KGW3102 Modbus Gateway converts between Modbus TCP and Modbus RTU/ASCII protocols. The
KGW3102 Modbus Gateway support redundant power support and 2KV electromagnetic isolation protection in
serial ports.
The following topics are covered in this chapter:

Overview

Package Checklist

Product Features
1
1.1 Overview
KGW3102 Modbus gateway is a redundant power supply Modbus gateway which converts between Modbus
TCP and Modbus RTU/ASCII protocols. For Ethernet port, it can be accessed up to 16 TCP Master/Client
devices, or connect to 16 TCP Slave/Server devices. For each serial port, it can physically manage up to 128
serial Master/Slave nodes. All serial ports of gateways provide 2KV isolation protection. Each
RS-232/RS-422/RS-485 serial port can be configured individually for Modbus RTU or Modbus ASCII, allowing
both types of networks to be integrated with Modbus TCP through one Modbus gateway.
KGW3102 Modbus gateway supports both Transparent mode and Agent mode. In Transparent mode, the
gateway will bypass and translate Modbus commands between Modbus TCP/ RTU/ASCII. In Agent mode, the
gateway will activeltactively poll the Modbus slave devices and store datasdata in the Modbus’s memory. The
Modbus master can retrieve Modbus slave devices’ datasdata via the gateway’s memory.
1.2 Package Checklist
The KGW3102 Modbus gateway is shipped with the following items:
•
KGW3102 Modbus Gateway
•
Installation Guide
•
SoftwareDocumentation CD
•
Product Warranty Statement
NOTE: Notify your sales representative if any of the above items is missing or damaged.
1.3 Product Features
•
Convert between Modbus TCP and Modbus RTU/ASCII Integration of Modbus RTU/ASCII Master/Slave
mode
•
1 auto detectable 10/100Mbps ethernetEthernet port and 2 RS-232/RS-422/RS-485 serial ports
•
Up to 16 TCP Master/Client devices, or connect to up to 16 TCP Slave/Server devices for Ethernet ports
•
Up to 128 Master/Slave slaves for each serial port
•
15KV ESD protection for each serial port
•
2KV electromagnetic isolation protection for each serial port
•
Support HTTPS, SSH2 security configuration protocol
•
Support redundant 12-48V DC power supply
•
Support surge protection for each interface and power line
•
Support "Reset to Factory Default Settings"
•
Support IP40 protection level
•
Certificates:CE, FCC, UL61010, C1D2 and RoHS
2
2. Getting Started
This chapter will include the contents as follows.

Connecting Power

Connecting Serial Devices

RS-485 Termination Resistors

Connecting to a Host or the Network

LED IndicatersIndicators

Dimension Figures

Pin Assignments


Ethernet Ports (RJ45)

Serial Ports (DB9 Male)

Power Input Ports
Specifications
3
2.1 Connecting Power
The KGW3102 Modbus gateway can be powered by connecting the power source to the terminal block, and
the instruction is as follows.
1. Loosen or remove the screws on the terminal block.
2. Connect the 12~48 VDC power cable to the terminal block.
3. Tighten the connections using the screws on the terminal block.
Note: KGW3102 Modbus gateway does not have the On/Off switch. It automatically run when it is powered on.
The PWR LED on the top panel will glow to indicate that the device is powered on. The device supports two
redundant DC power supply.
2.2 Connecting Serial Devices
The serial ports are on the front panel. If you connect to the network with multiple devices, please note the
following:
1. All devices that are connected to a single serial port must use the same protocol (i.e., either Modbus RTU or
Modbus ASCII).
2. Each master device must get its own port on the device.
Please refer to the 2.5 section for the guide of serial port :Pin Assignments.
2.2.1 Setting RS-485 Terminal Resistors
When build up the RS485 network in bad conditions, you may need to add terminal resistors to prevent the
reflection of serial signals. There is a built-in 120KΩ terminal resistor in KGW3102. For each serial port, DIP
switches on the top panel are used to enable/disable the terminal resistors.
SetingSetting the 120 Ω termination resistor: the switch 1/2 corresponds to the serial port S1/S2. When switch
1/2 is set to “ON”, it enable the terminal resister, and when switch 1/2 is set to “OFF”, it disable the terminal
resistor. The gateway device disable terminal resistor by default.
2.2.2 Connecting to a Host or the Network
The 10/100M Ethernet port on the front panel is used to connect a host or Ethernet network. The gateway can
be connected to other hosts or networks by using this Ethernet port. In normal operation, you can use the
standard Ethernet cable to connect the device to Modbus TCP network. For initial configuration or
troubleshooting purposes, you may connect the device directly to a PC. When the Modbus gateway run, the
LED light in the port will light up for checking whether it is connected to the network.
One Ethernet port and one corresponded MAC address are provided by KGW3102. The IP address is editable
but the MAC addresse can not be changed.
4
2.3 LED Indicators
Item
Reset Button
Function
Press this button at least 5 seconds to reset the device to factory settings.
LED indicators
Steady on: Power is on.
PWR1/PWR2
Green
Off: Power is off, or power error
Blinking with 1Hz: Indicates the device is functioning normally.
Run
Green
Steady on: Power is on and device is booting up.
Steady on: Ethernet connection.
E1 (Link/ACT)
YellowGreen
Blinking: Ethernet port is receiving/transmitting data.
Off: Ethernet cable has disconnected.
Steady on: 100Mbps connection.(100Base-TX)
E1 (10/100M)
GreenYellow
Off: 10Mbps connection or Ethernet cable has disconnected.
Blinking: The serial port n is transmitting data.
Sn-T
Green
Off: No data is being transmitted or received through the serial port.
Blinking: The serial port n is receiving data.
Sn-R
Green
Off: No data is being transmitted or received through the serial port.
5
2.4 Dimension Figures
KGW3102 (unit: mm)
2.5 Pin Assignments
2.5.1 Ethernet Ports (RJ45)
Pin
1
Pin
2
MDI-X Signal
Ethernet
Rx+6
MDI Signal
Tx+
Rx-
Tx-
3
Tx+
Rx+
6
Tx-
Rx-
1
Pin
2
1
3
2
4
3
5
6
Tx+
MDI-X Signal
TxRx+
Rx+
Rx–
Tx+
–
Tx-
6
Rx4,5,7,8 Unused
7
–
8
MDI Signal
Tx+
TxRx+
RxUnused
–
2.5.2 Serial Ports (DB9 Male)
The KGW3102 Modbus gateway uses DB9 (male) serial ports to connect Modbus RTU or ASCII devices. Each
port supports three serial interfaces: RS- 232, RS-422 and RS-485, and all interface types can be configured
by the software.
Pin
RS-232
RS-422
RS-485
1
CTS
RxD-(B)
-
2
RxD
RxD+(A)
-
3
TxD
TxD-(Z)
Data-(B)
4
RTS
TxD+(Y)
Data+(A)
5
GND
GND
GND
6
–
–
7
–
–
8
–
–
9
–
–
–
2.5.3 Power Input Ports
The KGW3102 Modbus gateway is equipped with phoenix terminal whose space is 5.08mm, it has dual power
inputs PWR1 and PWR2 for redundancy.
Powe
Pin
FuncitonFunction
r
PWR1
+/L
PWR1 connects to +/L
-/N
PWR1 connects to -/N
+/L
PWR2 connects to +/L
-/N
PWR2 connects to -/N
PWR2
7
2.6 Specifications
Ethernet Interface
Number of Ports: 1
Speed: 10/100 Mbps, Auto MDI/MDIX
Connector: RJ45 × 1
Protocols: Modbus TCP
Magnetic Isolation Protection: 1.5 KV (built-in)
Serial Interface
Number of Ports: 2
Serial Standards: RS-232/RS-422/RS-485, software option supported
Connector: DB9 Male
ESD Protection: 15KV ESD
Magnetic Isolation Protection: 2 KV (built-in)
DIP Switch: Enable/Disable RS-485 terminal resistance
Protocols: Modbus RTU/ASCII Master/Slave
Serial Communication Parameters
Data Bits: 7, 8
Stop Bits: 1, 2
Parity: None, Even, Odd, Space, Mark
Flow Control: XON/XOFF, RTS/CTS, None
BaudrateBaud rate: 300bps - 460.8kbps
Serial Signals
RS-232: TxD, RxD, RTS, CTS, GND
RS-422: Tx+, Tx-, Rx+, Rx-, GND
RS-485-2w: Data+, Data-, GND
Software
Security Protocols:HTTPS, SSH2
LEDs
8
System: PWR1, PWR2, RUN
Serial Port: S1-T/R、S2-T/R
LAN: SPEED, ACT/LINK (RJ45)
Buttons
Reset: Supports "Reset to Factory Default Settings"
Physical Characteristics
Housing: Aluminum
Weight: 170g
Dimension: 30×115×68 mm(1.8×5.3×7.3 in)
Protection Level: IP40
Installation: DIN-rail mounting
Environmental Limits
Operating Temperature: -40 to 75℃
Storage Temperature: -40 to 85℃
Operating Humidity: 5 to 95% RH
Power Requirements
Input Voltage:24VDC recommended (12-48VDC)
Connection Terminal: 5.08mm spacing phoenix terminal block
System Consumption: 1.8W
Surge Protection: Support
Reverse Connect Protection: Support
Redundancy Power supply: Support
Standards and Certifications
Certifications: CE, FCC, UL61010,C1D2, RoHS
EMI:
EN 55032 Class A
FCC Part 15 Subpart B Class A
EN 55024
9
EMS:
IEC61000-4-2(ESD): ±6kV(contact),±8kV(air)
IEC61000-4-3(RS): 10V/M (80MHz–1GHz2GHz)
IEC61000-4-4(EFT): Power Port:±2KV;Data Port:±1KV
IEC61000-4-5(Surge): PowerPortPower Port: ±1KV/DM, ±2KV/CM; Data Port:±1KV
IEC 61000-4-6 (CS): 10V(150KHz-80MHz)
Machinery:
Vibration: IEC60068-2-6
Surge: IEC60068-2-27
Free-drop: IEC60068-2-32
Warranty
Warranty Period: 5 years
3. Typical Applications
Some typical applications of KGW3102 are covered in this chapter as following topics:

Ethernet Masters with Multiple Serial Slaves

Serial Masters with Multiple Ethernet Slaves
10
3.1 Ethernet Masters with Multiple Serial Slaves
The Ethernet Master can connect multiple Serial Slaves. The KGW3102 supports Modbus TCP Master with up
to 16 Modbus TCP Master simultaneous connections. The serial interface supports RS-232, RS-422 and
RS-485 modes through software settings.
A. Transparent-A
What we define Transparent-A as the process from Modbus TCP Master to Modbus RTU/ASCII Slave in
Transparent mode. In this mode, the ethernetEthernet ports should be in Modbus TCP Slave mode, and the
serial ports should be in Modbus RTU/ASCII Master mode.
B. Agent-A
What we define Agent-A as the process from Modbus TCP Master to Modbus RTU/ASCII Slave in Agent mode.
In this mode, the ethernetEthernet ports should be in Modbus TCP Slave mode, and the serial ports should be
in Modbus RTU/ASCII Master mode.
11
3.2 Serial Masters with Multiple Ethernet Slaves
The serial port Masters can connect to more than one ethernetEthernet Slaves. The KGW3102 Modbus
gateway supports Modbus TCP Slave with up to 16 simultaneous connections. The serial interface supports
RS-232, RS422 and RS-485 modes through software settings.
A. Transparent-B
What we define Transparent-B as the process from Modbus TCP Slave to Modbus RTU/ASCII Master in
Transparent mode. In this mode, the ethernetEthernet ports should be in Modbus TCP Master mode, and the
serial ports should be in Modbus RTU/ASCII Slave mode.
12
B. Agent-B
What we define Agent-B as the process from Modbus TCP Slave to Modbus RTU/ASCII Master in Agent mode.
In this mode, the ethernetEthernet ports should be in Modbus TCP Master mode, and the serial ports should be
in Modbus RTU/ASCII Slave mode.
13
4. Web Console Configuration
The KGW3102 Modbus gateway can be configured by built-in Web page, and you can access the home
page of KGW3102 through browersbrewers like Mozilla Firefox browerBrower, Microsoft IE browser. The
following topics are covered in this chapter:

Log In

Device Information

Network Settings

Operating Settings

Operation Mode Settings

Transparent Mode

Agent Mode

Serial Port Settings

Agent Settings (Agent Mode)

Gateway Operation Settings

Device Listing

Data Query

Import/Export

Upgrade FirmeareFirmware

Change Password

Load Factory Default

Save/Reboot

Help

Logout
14
4.1 Log In
Firstly open your browser.
Then, input 192.168.0.249 (default for E1) in the address input box and click “Login”.
The default username is admin, and the password is admin. You can also select the operation language
(English or Chinese) as your convenience.
4.2 Device Information
You can see the basic information of the device in this page, such as the device name, module type, IP
address, current working mode, SN number, firmware version, MAC address and change to mode.
“Change to Mode” allows you to switch the device’s work mode between Transparent mode and Agent
mode by clicking. The mode will effect without restarting the device.
Note: the parameter modifications of gateway device(except firmware upgrade) is effective immediately by
clicking “Save” without restarting the device.
4.3 Network Settings
The Network Setting page is where the device’s network settings are configured. You can modify the IP
configuration, IP address, subnet address, default gateway, and the device name. Click“Save”to save the
current changes to the device and the changings are effective without reboot.
15
Network Settings:
•
IP configuration: Select “Static” if you are using a fixed IP address. Select “DHCP” if the IP address
is set dynamically.
•
IP address: The IP (Internet Protocol) address identifies the server on the TCP/IP network. The
default setting E1 is 192.168.0.249
•
Netmask: It identifies the server as belonging to a Class A, B, or C network. The default setting is
255.255.255.0
•
Gateway: It is the IP address of the router that provides network access outside the server’s LAN.
•
Device Name: The default model is KGW3102
4.4 Operating Settings
4.4.1 Operation Mode Settings
The KGW3102 Modbus gateway supports two operation mode: Transparent mode and Agent mode. You
can see the current operation mode in overview page. When powered on, the device’s default operation
mode is Transparent mode, and it can be switched to Agent mode without restarting the device.
4.4.2 Transparent Mode
A.
Transparent-A: Modbus TCP Master- Modbus RTU/ASCII Slave
In this mode, the ethernetEthernet ports should be in Modbus TCP Slave mode, and the serial ports
should be in Modbus RTU/ASCII Master mode. The serial port mode should be set to RTU Master mode
or ASCII Master mode. The following is RTU Master mode.
16
Transparent-A Parameters:
•
Operating Mode: RTU Master, ASCII Master
•
Filter Function: enable/disable the Modbus ID filter function
•
Filter ID Start: starting filtered Modbus ID in range of 1-247
•
Filter ID End: ending filtered Modbus ID in range of 1-247
•
Protocol: TCP or UDP
•
Local Port: set port numbers for TCP/IP communication. The default number of port 1 is 502, and
the port 2 is 7002. The range of the local port is 1-65535
B.
Transparent-B: Modbus TCP Slave- Modbus RTU/ASCII Master
In this mode, the ethernetEthernet ports should be in Modbus TCP Master mode, and the serial ports
should be in Modbus RTU/ASCII Slave mode. The serial port mode should be set to RTU Slave mode or
ASCII Slave mode. The following is RTU Slave mode.
Transparent-B Parameters:
•
Operating Mode: RTU Slave, ASCII Slave
•
Slave ID: the Modbus TCP Slave ID, and the range is 1-247
•
Remote IP: the range of IP for Modbus TCP is 1-247
•
Remote port: the network communication port for Modbus TCP Server, and the range is 1-65535
•
Local Port: the port range is 1-65535
•
Protocol: TCP or UDP
17
•
Ethernet Binding: the network ports for specific data communication
•
Slave Device Operation: the gateway device can support up to 16 slave device which can be
pressdpressed “+” or “-” to add or remove the slave device
In the RTU/ASCII Slave mode, you should make sure the unique of the slave ID and IP address. The
remote port number and IP address must be unique, and the local port number should be unique as shown
in the following picture.
4.4.3 Agent Mode
When running in agent mode, two Modbus roles must be set. One is the ethernetEthernet side (Modbus
TCP), and the other is serial side (Modbus RTU/ASCII). The KGW3102 Modbus supports a Modbus TCP
function with Master (Client) and Slave (Server) modes. In Master mode, the Modbus works as a client and
tries to build a TCP connection with the remote Modbus TCP server. In this mode, you will need to specify
the IP address of the remote device and the relative Modbus command. For Slave mode, the Modbus works
as a server and waits for incoming connection from the Modbus TCP client. In this mode the Modbus will
waits for incoming Modbus TCP requests and use the internal memory as the Slave register to respond.
There are two work modes used as the serial side of the KGW3102 Modbus. One is the Modbus RTU/ASCII
Slave, and the other is Modbus RTU/ASCII Master. In Slave mode, you will need to specifiyspecify the ID,
remote IP and other parameters of the slave device. And in Master mode, for sending the Modbus
commands to the Modbus slave device you will need to specify the ID and relative requests of the slave
device. For the KGW3102 Modbus gateway, when the serial mode is set to be Slave mode, the
ethernetEthernet side will be Master mode automatically. If the serial mode is Master mode, the
ethernetEthernet side is automatically to be Slave mode.
A.
Agent-A: Modbus TCP Master- Modbus RTU/ASCII Slave
In Agent-A mode, the device ethernetEthernet side is to be Modbus TCP Slave mode, and the serial side
is to be Modbus RTU/ASCII Master mode. The serial mode should be set to RTU Master or ASCII Master.
The following is RTU Master mode.
18
Agent-A Parameters:
•
Operating mode: RTU Master or ASCII Master
•
Filter Function: enable/disable the Modbus ID filter function
•
Filter Start ID: the range is 1-247
•
Filter End ID: the range is 1-247
Agent-B: Modbus TCP Slave - Modbus RTU/ASCII Master
B.
In Agent-B mode, the device ethernetEthernet side is to be Modbus TCP Master mode, and the serial side
is to be Modbus RTU/ASCII Slave mode. The serial mode should be set to RTU Slave or ASCII Slave.
Agent-B Parameters:
•
Operating mode: RTU Slave or ASCII Slave
•
Slave ID: the range of the ID of the Modbus TCP Slave is 1-247
•
Remote IP: the IP address of the Modbus TCP
•
Remote port: the network communication port of the Modbus TCP Server
•
Local Port: the port range is 1-65535
•
Protocol: TCP or UDP
•
Slave Device Operation: the gateway device can support up to 16 slave device which could be
pressdpressed “+” or “-” to add or remove the slave device
In RTU/ASCII Slave mode, you should note that the set of the TCP Slave ID and IP address and the
19
remote port number can be same, but the remote port number and IP address must be unique, and the
local port number should be unique as well. It is shown as the following picture.
4.5 Serial Settings
The Serial Setting page is where serial port’s communication parameters are configured. You can modify
the Alias Name, Baud Rate, Data Bit, Parity, Stop Bit, Flow Control, and Hardware Interface. Click “Save” to
save the current changes to the device.
Serial Parameters:
•
Alias: the modifiable name of the serial ports
•
Baud Rate: support 300bps~460800bps
•
Date Bits: 7,8 (ASCII: 7; RTU: 8)
•
Stop Bits: 1, 2
•
Parity: support None, Even, Odd, Space and Mark
•
Flow Control: support None, RTS/CTS, and XON/XOFF
•
Hardware Interface: support RS-232, RS-485 and RS-422
4.6 Agent Settings (Agent Mode)
Only in Agent mode some agent settings should be carried out for the serial ports in KGW3102, such as
gateway settings, slave list, and data query. Click “Save” to save the current changes to the device. There is
no set operating in transparent mode.
20
4.6.1 Gateway Settings
Gateway Parameters:
•
Gateway Modbus ID: the Modbus address for KGW3102 ranging from 1 to 247
•
Protocol: TCP or UDP (only in the Slave mode network protocol setting, the setting in Master mode
is invalid)
•
Default Timeout (ms): the default timeout ranges form 0 to 6000 ms. Some Modbus Slaves may
take more time to boot up than other devices. For certain conditions, it may cause the entire
system suffering from repeated exceptions during the initial boot-up. You can force KGW3102 to
waiting for booting up before sending the first request with the Initial Delay setting
•
Inter-packet TX Delay (ms): the time-delay to transmit the packet received from the slave device to
the upstream. It is the time waiting for the Modbus slave response.
4.6.2 Slave List
The slave list is used for Modbus Slave configuration. You can add, delete, and modify the slave device as
well as export the current slave list.
Slave List Parameters:
•
Add New Slave: add new Modbus slave device
•
Delete Slave: delete current Modbus slave device
•
Modify Slave: modify the parameters of current Modbus slave device
•
Display: display current Modbus slave devices, 10, 20, 50, 100, All
•
Export: export current Modbus slave devices, support Excel, CVS, and PDF file format
21
•
Searching: search current Modbus slave device by some key words
•
COM: the serial port of device (S1, S2)
•
Device ID: the ID of the terminal device with 128 slave IDs for each serial port
•
Alias: the name of terminal device
•
Function Code: the function ID of each terminal device
•
Data Address: the starting data address of terminal device
•
Data Length: the data length of terminal device
•
Mapping Address Head: the mapping address of terminal device, which means the address of
stored data reading from serial slave device. The mapping address heads are different because of
the Modbus function ID. The reading data with same function ID can not be stored in the
overlapped device, on the other side, the reading data with different function ID can stored in
overlapped device.
•
State: the current state of the Modbus configuration communication. Red: communication
disconnection; Green: communication in normal
A. Add New Slave
Click “Add New Slave” button to enter the configuration page.
Add New Slave Parameters:
•
Device Alias: the added new Modbus terminal device name (Default: Device Alias), and the name
is modifiable (16 characters or less)
•
Serial Port: S1, S2
•
Slave ID: the ID of added slave device(1-247)
•
Function Code: the function code of Modbus protocol
01: read the coils state
02: read the input state
22
03: read the holding registers
04: read the input registers
•
Data Start Address: the starting data address of device, ranging from 0 to 65535
•
Data Length: the data length written into terminal device ranging from 1 to 2000
•
Mapping Address: the mapping address of terminal device data, ranging from 0 to 65535. You can
choose to automaticllyautomatically assign mapping address while the device address is
reduntantredundant occupation.
B. Delete Slave
Select the slave device to be deleted, click “Delete Slave”, and click “Save” once all the settings have been
changed.
C. Modify Slave
Select the slave device to be modified and click “Modify Slave” to enter the configuration page. The
parameters of “Modify Slave” page are same with “Add New Slave” page’s.
4.6.3 Data Query
You can use the data query function to read the datasdata in the gateway device's current registers.
The data query function is queried according to the function code.
Data Query Parameters:
•
Function ID: the number of the queried data(01,02,03,04)
•
Data Start Address: the starting data address of device, ranging from 0 to 65535
•
Data Length: the data length written to slave device, ranging from 1 to 125
•
Gateway Address: display the datasdata started from the settinged data query starting address in
device registers
•
Value (decimalismdenialism): displaying the data in the register in decimal form
23
•
Value (hexadecimal): displaying the data in the register in hexadecimal form
4.7 Import/Export
The page is to import or export the configuration file for KGW3102. The device name, networks, the serial
parameters and operating mode in imported file can be modified.
Import/Export Parameters:
•
Export Config. File: to export the configuration file of the device
•
Import Config. File: to import the modified configuration file of the device
•
Upload Status: the progress bar of uploading file
4.8 Upgrade Firmware
The Upgrade Firmware page is where the gateway’s firmware can be upgraded, and the “Upload Status” is
the progress bar of upgrading firmware. After the upgrade success, reboot the gateway device and the
system will start with the new firmware.
4.9 Change Password
You can modify the user’s password in this page (now the default username is admin, and the default
password is admin).
Password Modify: After input the current password, input the new password twice, then click the “Save” to
save the changed password.
Security Management: The default set is vistingvisiting to HTTP(Web) Console; After click “HTTPS”, enable
to visit the HTTPS(Web) Console.
24
4.10 Load Factory Default
The Load Factory Default page is to reset the gateway to factory setting.
Note: all parameters of the device will be reset to the factory setting, so please do not use the function
unless you confirm.
4.11 Save/Reboot
All changes will effect by clicking the “Save” without restarting the gateway. If you need to restart the device,
click "reboot" to restart the device.
4.12 Help
When you have questions, you can click “Help” button located in the top right corner of each configuration
page.
4.13 Logout
For safety reasons, remember to log out to prevent people accessing the gateway without the proper
authorization.
25
5. Case Studies
The following topics are covered in this chapter:

Transparent-A

Transparent-B

Agent-A

Agent-B
26
5.1 Transparent-A
Using a KGW3102 Modbus Gateway and a PC in Transparent-A mode, the port type is RS-232. The
ethernetEthernet side works as a Modbus TCP Slave. Connect S1 working as a Modbus RTU/ASCII Slave
to PC by DB9 cable.
A. Web Configuration
Power on KGW3102 and log in web server of the device, set the operation mode of device to Transparent
Mode in “Overview” page.
Then, click “Operating Settings” in navigation bar to set Port S1 to RTU Master mode, and click “Save” to
save the change.
Click “Serial Settings” in navigation bar to set the parameters of S1 according to the conditions. At last click
the “Save” to save the change.
27
B. PC Configuration
Connect PC and the gateway serial port(S1) by DB9 female cable to configure for PC. Run “Modbus Slave”
software on PC. The “Modbus Slave” parameters must be configured as shown in the following figure.
Connection: Serial Port
Mode: RTU
And then click “OK” into the application page.
Now run “Modbus Poll” on PC and set the parameters as shown in the following figure. Configure PC which
was connected to E1 to 192.168.0.249. And then click “OK”, enter the application page.
Finally, input numbers in address 1 and address 2 respectively in “Modbus Slave”, the corresponding datas
28
are as shown in the following figure.
5.2 Transparent-B
Using a KGW3102 Modbus Gateway and a PC in Transparent-B mode, the port type is RS-232. The PC
works as a Modbus TCP Master. Connect S1 working as a Modbus RTU/ASCII Slave to PC by DB9 cable.
A. Web Configuration
Power on KGW3102 and log in web server of the device, choose the operation mode of device to
Transparent Mode in “Overview” page.
Then, click “Operating Settings” in navigation bar to set S1 to RTU Slave mode, click “Save” to save the
change.
Click “Serial Settings” in navigation bar to set the parameters of each serial port, and click “Save” to save
the change.
29
B. PC Configuration
Connect PC and the gateway serial port(S1) by DB9 female cable to configure for PC. Run “Modbus Poll”
software on PC. The “Modbus Poll” parameters must be configured as shown in the following figure.
Connection: Serial Port
Mode: RTU
Please note that the Slave ID should be same with the ID in “Operating Mode”. And then click “OK” enter the
application page.
30
Then run the “Modbus Slave” software on PC and set the parameters as it is shown in the following figure,
click “OK” to enter the application page. In Setup—>Slave Definition, the Slave ID should be same as the ID
in “Operating Mode”.
After configuration, input number in address 1 and address 2 respectively in “Modbus Slave” software, and
you can see the numbers in corresponding address in “Modbus Poll” software.
31
5.3 Agent-A
Using a KGW3102 Modbus Gateway and a PC in Agent-A mode, the port type is RS-232. The
ethernetEthernet side works as a Modbus TCP Slave. Connect S1 working as a Modbus RTU/ASCII Master
to PC by DB9 female cable.
A. Web Configuration
Power on KGW3102 and log in web server of the device, set the operation mode of device to Agent Mode in
“Overview” page.
Next click “Operating Settings” in navigation bar to set S1 to RTU Master mode, and click “Save” to save the
change.
Then set the parameters of each serial port, click “Save” to save the change.
32
Click “Agent Settings” in navigation bar and select “Gateway Settings” to set the parameters of the device,
and click “Save” to save the change.
Enter the “Device List” in navigation bar and click “Add New Slave” to add a new slave device.
B. PC Configuration
Run “Modbus Slave” software on PC. The “Modbus Slave” parameters must be configured as shown in the
following figure. And then click “OK” to enter the application page.
After configuration, click “OK” enter the application page, add a Modbus RTU slave that be same with
Modbus Slave terminal device.
33
Then, run “Modbus Poll” on PC and set the parameters as shown in the following figure.
Connection: TCP/IP
Mode: RTU
IP: 192.168.0.249
Port: 502
And then click “OK” to enter into the application page.
In the application page, set the Slave ID in Setup—>Read/Write Definition be same with the Modbus ID in
“Gateway Settings”, then add a Modbus TCP device in corresponded to the Modbus Slave terminal device.
34
Finally, input number in address 1 and address 2 respectively in “Modbus Slave” software, and you can see
the numbers in corresponding address in “Modbus Poll” software.
5.4 Agent-B
Using a KGW3102 Modbus Gateway and a PC in Agent-B mode, the port type is RS-232. The
ethernetEthernet side works as a Modbus TCP Master. Connect S1 working as a Modbus RTU/ASCII Slave
to PC by DB9 female cable.
A. Web Configuration
Power on KGW3102 and log in web server of the device, set the operation mode of device to Agent Mode in
“Overview” page.
Then, click “Operating Settings” in navigation bar to set S1 to RTU Slave mode, and click “Save” to save the
change.
35
Then, click “Serial Settings” in navigation bar to set the parameters of each serial port. The mode in
“Protocol” is RTU Slave. At last, click the “Save” to save the change.
Next click “Agent Settings” in navigation bar and select “Gateway Settings” to set the parameters of the
device. At last, click the “Save” to save the change.
Finally click “Device List” in navigation bar and click “Add New Slave” to add a new slave device.
B. PC Configuration
Run “Modbus Poll” software on PC. The “Modbus Poll” parameters should be configured as shown in the
following figure.
Connection: Serial Port
Mode: RTU
And then click “OK” to enter the application page.
36
In the application page, make the Slave ID in Setup—>Read/Write Definition be same with the Modbus ID in
“Gateway Settings”, and then add Modbus RTU device in corresponded to the terminal device.
Then, run “Modbus Slave” on PC and set the parameters as shown in the following figure.
Connection: TCP/IP
Mode: RTU
Port: 8001
And then click “OK” to enter the application page.
37
In the application page, add a Modbus TCP slave device in corressponded to the Modbus Slave terminal
device.
Finally, input number in address 1 and address 2 respectively in “Modbus Slave”, and you can see the
numbers in corresponding address in “Modbus Poll” software.
38
Download PDF
Similar pages