You are on page 1of 87

Amsamotion

Amsamotion
帮助一百万家企业实现自动化智能制造
Smart manufacturing automation for more than one million companies

封面
Cover

ETH-MODUBS-IO16R 模块产品手册
eTH-MODUBUS-IO16R module
product manual
--V1.0
-- v1.0
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

目录
Table of contents
目录
Table of contents

一、产品概述 ............................................................................................................................................................. 1
Product Overview 1

1.1、产品简介 ..................................................................................................................................................... 1
1.1 product description 1
1.2、特点功能..................................................................................................................................................... 1
1.2 features 1
1.3、应用场景..................................................................................................................................................... 2
1.3. Application Scenario 2

二、 产品规格 ............................................................................................................................................................ 2
Product Specification 2
2.1、产品参数..................................................................................................................................................... 2
2.1. Product parameters 2
2.2、端子接线 .................................................................................................................................................... 4
2.2. Terminal 4
2.2.1、端子接线 .......................................................................................................................................... 4
2.2.1 Terminal 4
2.2.2、端子功能说明: ............................................................................................................................. 5
2.2.2, terminal function description: 5
2.2.3、COM2 口(DB9 母头)引脚定义 ................................................................................................. 6
2.2.3. COM2 port (DB9 master) pin definition 6
2.2.3、输入信号说明: ............................................................................................................................. 6
2.2.3 input signal specification: 6

三、端口与寄存器地址说明 ..................................................................................................................................... 7
Port and register address description 7

3.1、ETH-MODBUS-IO16R 的 TCP 链接端口功能对应表 .............................................................................. 7


3.1. Table 7 of TCP link port function of ETH-MODBUS-IO16R
3.2、ETH-MODBUS-IO16R 的串口功能对应表 .............................................................................................. 8
3.2, ETH-MODBUS-IO16R serial port function corresponding table 8
3.3、端口数据缓冲区长度说明 ........................................................................................................................ 9
3.3 port data buffer length description 9
3.4、数字输入地址 ............................................................................................................................................ 9
3.4 numeric input address 9
3.5、数字输出地址 ............................................................................................................................................ 9
3.5 digital output address 9
3.6、保持寄存器地址 ...................................................................................................................................... 10
3.6. Hold Register address 10
3.7、系统参数(上位机修改) ............................................................................................................................ 10
3.7, system parameters (upper machine modification)10

四、产品功能 ........................................................................................................................................................... 11
Product features 11

4.1、MODBUS TCP 功能 ................................................................................................................................. 11


Modbus TCP features 11
4.2、MODBUS TCP 转 MODBUS RTU 功能 .................................................................................................. 11
Modbus TCP to Modbus RTU 11
4.3、MODBUS RTU 转 MODBUS TCP 功能 .................................................................................................. 12
Modbus RTU to Modbus TCP function 12
4.4、MODBUS RTU 功能 ................................................................................................................................ 12
Modbus RTU function 12
4.5、MODBUS TCP 控制多从站功能............................................................................................................. 13
4.5. Modbus TCP control multiple slave function 13
4.5.1、功能说明........................................................................................................................................ 13
4.5.1 functional description 13
4.5.2、功能配置 ....................................................................................................................................... 13
4.5.2, configuration 13
4.5.3、功能测试 ....................................................................................................................................... 14
4.5.3 functional testing 14
4.6、TCP 转 RS485 透传功能 ......................................................................................................................... 15
4.6. TCP to RS485 transmission 15
4.7、按键恢复出厂设置功能 .......................................................................................................................... 15
4.7 press the button to restore factory settings 15

五、参数配置 ........................................................................................................................................................... 16
Configuration 16
5.1、配置前准备 ............................................................................................................................................... 16
5.1 preconfiguration 16
5.2、使用“艾莫迅 MODBUS 调试工具”配置 ................................................................................................. 17
5.2. Configuration using the Modbus debugging tool for imox 17
5.2.1、调试工具的连接 ............................................................................................................................ 17
5.2.1 connection of debugging tools 17
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.2.2、修改本机 IP ................................................................................................................................... 18
5.2.2, modify native IP 18
5.2.3、修改本机地址 ............................................................................................................................... 19
5.2.3, modify local address 19
5.2.4、修改 COM 口参数 ........................................................................................................................ 20
5.2.4, modify COM port parameters 20
5.2.5、修改串口模式 ............................................................................................................................... 22
5.2.5. Modify serial port mode 22
5.2.6、修改总线掉电保持 ....................................................................................................................... 22
5.2.6, modify the bus power down to 22
5.3、网页配置 .................................................................................................................................................. 24
5.3 page configuration 24
5.3.1、登陆模块 IP 网页 .......................................................................................................................... 24
5.3.1. Login module IP page 24
5.3.2、模块 IP 设置 .................................................................................................................................. 25
5.3.2 module IP settings 25
5.3.3、远端服务器 IP 设置 ...................................................................................................................... 26
5.3.3, remote server IP settings 26
5.3.4、COM2 口参数设置 ....................................................................................................................... 27
5.3.4, COM2 port setting 27

六、MODBUS TCP 报文格式说明 ........................................................................................................................ 30


Modbus TCP message format specification 30

6.1、数字量输入信号采集命令 ....................................................................................................................... 30
6.1, digital input signal acquisition command 30
6.2、数字量输出信号采集命令 ...................................................................................................................... 31
6.2, digital output signal acquisition command 31
6.3、数字量输出信号单个控制命令 .............................................................................................................. 32
6.3 digital output signal single control command 32
6.4、数字量输出信号多个控制命令 .............................................................................................................. 34
6.4 digital output signal multiple control commands 34
6.5、输入寄存器读出命令 .............................................................................................................................. 35
6.5 input register read command 35
6.6、保持寄存器读出命令 .............................................................................................................................. 37
6.6. Keep Register read command 37
6.7、写单个保持寄存器命令 .......................................................................................................................... 38
6.7 write single hold register command 38
6.8、写多个保持寄存器命令 .......................................................................................................................... 39
6.8. Write multiple hold register commands 39

修订历史
Revision history

关于我们
About Us
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

一、产品概述
Product Overview

1.1、产品简介
1.1 product introduction

ETH-MODBUS-IO16R 模块是一款多功能串口服务器,除了自带开关量采集控制、模拟

量采集输出通道,还加入 RJ45 接口,使它在用于串口通讯的 MODBUS RTU 功能上,增加

与网口设备 MODBUS TCP 协议通讯的转换,亦可通过 RS485 串口与以太网间的双向透明传

输,使具有 RS485 接口的设备具备联入 TCP/IP 网络的能力。同时 2 路独立 RS485 串口,扩

展了 1 路物理通讯链路。更支持拨码设置串口波特率、站号,“六合一”MODBUS RTU 从

站等实用功能,是一款经济稳定、功能强大的产品。

ETH-MODBUS-IO16R module is a multi-function serial port server. In addition to

the on-off data acquisition and control, analog data acquisition and output channels,

RJ45 interface is added to make it work on Modbus RTU function for serial

communication, by increasing the conversion of Modbus TCP protocol

communication with the network interface equipment, the equipment with RS485

interface can be connected to TCP/IP network through the two-way transparent

transmission between RS485 serial port and Ethernet. At the same time, 2

independent RS485 serial ports extend 1 physical communication links. More support

dial code set serial port baud rate, station number, “Six in one”Modbus RTU slave

station and other practical functions, is an economic stability, powerful products.

1.2、特点功能
1.2 features

 16 路光电隔离数字量输入,16 路继电器数字量输出(对应数量状态指示灯)
16 photoelectric isolation digital input, 16 relay digital output (corresponding to the
number of status indicator)

 2 路 485 接口,1 路 DB9 母头,1 路端子,独立使用
2-way 485 interface, 1-way DB9 master, 1-way terminal, independent use

 1 路 RJ45 型网口,10/100Mbps 以太网通讯
RJ45 port, 10/100 Mbps Ethernet communication

 带波特率、站号拨码开关,方便设置模块参数
With baud rate, station number dial switch, easy to set module parameters

 支持 MODBUS TCP,MODBUS RTU 及 TCP 协议,同时支持 4 路 MODBUS TCP 连接
Modbus supports Modbus TCP, Modbus and TCP protocols, as well as 4 Modbus
TCP connections

 系统内置 MODBUS TCP 转 MODBUS RTU、MODBUS RTU 转 MODBUS TCP;可作为
System built-in Modbus TCP to Modbus RTU, Modbus RTU to Modbus TCP; can be
used as

MODBUS TCP 网络服务器或客户端
Modbus TCP network server or client

 支持将最多 6 个 MODBUS RTU 从站与本模块转换为对应配置点数的 1 个 MODBUS TCP
Support to convert up to 6 Modbus RTU from station and this module to 1 Modbus TCP
corresponding to the number of configuration points

服务器控制
Server control

 专用上位机可设置模块参数永久保存
The special upper computer can set the module parameters to be saved permanently

 电源电路采用防反接设计
The power supply circuit adopts anti-reverse connection design

 广泛用于工业现场设备的信号采集和控制
It is widely used in signal acquisition and control of industrial field equipment

1
www.amsamotion.com
Www.amsamotion. Com 1
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

1.3、应用场景
1.3 application scenarios

ETH-MODBUS-IO16R 模块的可应用范围很广,如:PLC 控制、工业自动化、楼宇自控、


ETH-MODBUS-IO16R module can be used in a wide range of applications, such as:
PLC Control, industrial automation, building automation,

POS 系统、电力监控、门禁医疗、考勤系统、自助银行系统、电信机房监控、信息家电、LED
POS system, power monitoring, access control, attendance system, self-service
banking system, telecom room monitoring, information appliances, LED

信息显示设备、测量仪表及环境动力监控系统、售饭系统等含 RS485 串口的设备或系统。


information display equipment, measuring instruments, environmental power
monitoring system, rice selling system and other equipment or systems with RS485
serial port.

二、产品规格
Product specification

2.1、产品参数
2.1. Product parameters

主要参数
Main parameter
输入接口(DI)
Input Interface (DI)
输入点数
Number of input 16 路
points Route 16
输入信号类型 开关触点信号或电平信号
Input signal type Switch contact signal or level signal
输入信号有效范围
Effective range of DC 18~28V
input signal DC 18 ~ 28V
绝缘回路 光耦隔离
Insulation Loop Optocoupler isolation
输出接口(DO)
Output Interface (DO)
输出点数
Number of output 16 路
points Route 16
输出类型 继电器输出,常开触点
Output type Relay output, normally open contacts
触点容量 30VDC/5A 250VAC/5
Contact capacity 30VDC/5A 250VAC/5
绝缘回路 机械绝缘
Insulation Loop Mechanical insulation
COM1(RS485 通讯参数)
COM1(RS485 communication parameter)
接口类型 RS485,接线端子
Interface type RS485, terminal
波特率 4800~115200(可配置)
Baud rate 4800 ~ 115200(configurable)
通信格式
Communication 默认 8 位数据,1 位停止,无校验(可配置)
format Default 8-bit data, 1-bit stop, no check (configurable)
1)MODBUS TCP 转 MODBUS RTUMODBUS RTU
1) Modbus TCP to Modbus RTU
2)MODBUS RTU:
2) Modbus RTU:
针对本模块站号,功能为本模块被 MODBUS RTU 主站访问
通信模式 This module is accessed by Modbus RTU main station according to the station
Communication mode number of this module
针对其余站号,功能为 MODBUS RTU(主站)转 MODBUS TCP(服务
端)
For the other station, the function is Modbus RTU (main station) to Modbus
TCP (server)
3)TCP 透传
3) TCP transmission
地址范围 1~254
Address Range 1 ~ 254
传输距离 1200 米
Transmission distance 1,200 meters
COM2(RS485 通讯参数)
COM2(RS485 communication parameter)
接口类型 RS485,DB9 母头:3 线(A+),8 线(B-);5 线(地)
Interface type RS485, DB9 Master: 3 lines (A +) , 8 lines (B -) ; 5 lines (ground)
波特率 4800~115200(出厂时 9600,波特率拨码开关配置)
Baud rate 4800 ~ 115200(ex factory 9600, baud rate dial switch configuration)
通信格式
Communication 默认 8 位数据,1 位停止,无校验(可配置)
format Default 8-bit data, 1-bit stop, no check (configurable)

2
www.amsamotion.com
Www.amsamotion. Com 2
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

续表:
Continuation:
1)MODBUS TCP 转 MODBUS RTUMODBUS RTU
1) Modbus TCP to Modbus RTU
2)MODBUS RTU:仅对本模块站号,功能为本模块被 MODBUS RTU 主站
访问
通信模式 2) Modbus RTU: This module is accessed by Modbus RTU main station only
Communication mode 3)TCP 透传
3) TCP transmission
4)MODBUS RTU 主站
4) Modbus RTU Master Station
地址范围 1~254
Address Range 1 ~ 254
传输距离 1200 米
Transmission distance 1,200 meters
网络通讯参数
Network
communication
parameter
接口形式 RJ45
Interface form RJ45
网络类型 局域网
Network type Local area network
IP 地址 192.168.1.12(可配置)
IP address 192.168.1.12(configurable)
通讯协议
Communication MODBUS TCP、TCP/IP
protocol Modbus TCP, TCP/IP
速率 10/100Mbps;全双工;自适应
Rate 10100mbps; full duplex; adaptive
电源参数
Power parameter
工作电压 DC 18V~35V;带防反接保护
Operating voltage DC 18V ~ 35V; with protection against reverse connection
功耗 2W~4W
Power consumption 2W ~ 4W
工作环境
Working Environment
工作温度 -20℃~+70℃
Operating temperature - 20 °C ~ + 70 °C
存储温度 -40℃~+85℃
Storage temperature - 40 °C ~ + 85 °C
其他
In the news
安装方式 导轨
Installation mode Guide rail
尺寸 125MM(长)*80MM(宽)*50MM(高),以实物为准
Dimensions 125MM (length) * 80MM (width) * 50MM (height) , whichever is the material
3
www.amsamotion.com
Www.amsamotion. Com 3
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

2.2、端子接线
2.2 terminal wiring

2.2.1、端子接线
2.2.1 terminal wiring
4
www.amsamotion.com
Www.amsamotion. Com 4
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

2.2.2、端子功能说明:
Terminal function description:
1L Common terminal of Channel 1 ~ 4
Digital Output Channel
端子标号 第 1 路数字量输出
Terminal 功能说明 0.0 Channel 1 digital output
label Function description 第 2 路数字量输出
24+ DC 24V 电源正极 0.1 Digital output of Route 2
24 + DC 24V power positive pole 第 3 路数字量输出
0V DC 24V 电源负极 0.2 Digital output of Route 3
0v DC 24V power supply negative pole 第 4 路数字量输出
485 A 0.3 Channel 4 digital output
A 485a
485 B
B 485b
第 1~16 路数字量输入通道公共端
1M Common terminal of Channel 1 ~ 16
1m digital input channel
第 1 路数字量输入
0.0 Channel 1 digital input
第 2 路数字量输入
0.1 Channel 2 digital input
第 3 路数字量输入
0.2 Channel 3 digital input
第 4 路数字量输入
0.3 Channel 4 digital input
第 5 路数字量输入
0.4 Channel 5 digital input
第 6 路数字量输入
0.5 Channel 6 digital input
第 7 路数字量输入
0.6 Number seven input
第 8 路数字量输入
0.7 Route 8 digital input
第 9 路数字量输入
1.0 Route 9 digital input
第 10 路数字量输入
1.1 10th digital input
第 11 路数字量输入
1.2 Route 11 digital input
第 12 路数字量输入
1.3 Channel 12 digital input
第 13 路数字量输入
1.4 Route 13 digital input
第 14 路数字量输入
1.5 Route 14 digital input
第 15 路数字量输入
1.6 Route 15 digital input
第 16 路数字量输入
1.7 Route 16 digital input
1L 第 1~4 路数字量输出通道公共端
Route 15 digital output
第 16 路数字量输出
端子标号 1.7 Route 16 digital output
Terminal 功能说明 电源指示灯,上电常亮
label Function description PWR The power indicator lamp is always
第 5~8 路数字量输出通道公共端 Pwr on when the power is on
2L Common terminal of Channel 5 ~ 8 系统运行指示灯,正常时慢闪
2l digital output channel RUN System Operation Indicator Light,
第 5 路数字量输出 Run flash slowly when normal
0.4 Digital output of Route 5 COM 口通讯指示灯,COM1 通讯
第 6 路数字量输出 时闪
0.5 Route 6 digital output COM port communication indicator
light, COM1 communication flash
第 7 路数字量输出 烁黄灯,COM2 通讯时闪烁红
0.6 Route 7 digital output 灯,COM
第 8 路数字量输出 Flashing yellow light, COM2
0.7 Route 8 digital output COMM communication flashing red light,
COMM COM
第 9~12 路数字量输出通道公共端
口都通讯时两种颜色交叉闪烁
3L Common terminal of Channel 9 ~ 12 When both ports communicate, the
3l digital output channel two colors flash crosswise
第 9 路数字量输出 COM2 DB9 母头,485 接口
1.0 Route 9 digital output COM2 DB9 master, 485 interface
第 10 路数字量输出 ETH 10/100Mbps 网口
1.1 10th digital output Eth 10100mbps network port
第 11 路数字量输出 波特率 COM2 口波特率拨码开关
1.2 Route 11 digital output Baud rate COM2 port baud rate dial switch
第 12 路数字量输出 站地址
1.3 Route 12 digital output Station COM2 口模块站号拨码开关
第 13~16 路数字量输出通道公共端 address COM2 module station dial switch
3L Common terminal of digital output 复位模块 IP、站号、COM 口参数
3l channel for Route 13 ~ 16 复位按钮 等
第 13 路数字量输出 Reset Reset module IP, station number,
1.4 Route 13 digital output button COM port parameters
第 14 路数字量输出
1.5 Route 14 digital output
1.6 第 15 路数字量输出

5
www.amsamotion.com
Www.amsamotion. Com 5
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

2.2.3、COM2 口(DB9 母头)引脚定义


2.2.3. COM2 port (DB9 master) pin definition

引脚顺序 引脚作用 引脚名称


Pin sequence PIN action Pin name
NC
1 空 NC
GND
2 地 GND
485A
3 485A A
NC
4 空 NC
GND
5 地 GND
NC
6 空 NC
NC
7 空 NC
485B
8 485B B
NC
9 空 NC

2.2.3、输入信号说明:
2.2.3 input signal specification:

 输入信号支持正电/高电或负电/低电接入。
The input signal supports positive/high or negative/low power access.

 当输入为正电/高电有效时,公共端接电源负极,输入端子接对应的输入信号。
When the input is positive/high, the common terminal is connected to the negative
pole of the power supply and the input terminal is connected to the
corresponding input signal.

 当输入为负电/低电有效时,公共端接电源正极,输入端子接对应的输入信号。
When the input is negative/low active, the common terminal is connected to the
power supply positive, and the input terminal is connected to the corresponding
input signal.

6
www.amsamotion.com
Www.amsamotion. Com 6
ETH-MODBUS-IO16R 模块产品手册
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R module
Dongguan AMX Automation Technology Co. , Ltd. product manual

三、端口与寄存器地址说明
Port and register address description
3.1、ETH-MODBUS-IO16R 的 TCP 链接端口功能对应表
3.1, ETH-MODBUS-IO16R TCP link port function table

最大
IP 支持
Max
Ip Support
连接
Conn
端口号
ectin 详情描述
Port 功能
g Detailed description
number Function
数量
Quan
tity

1)当 MODBUS TCP 报文地址=模块地址时,对应 MODBUS TCP 功


能。
1) when the Modbus TCP PACKET ADDRESS = the module address,
corresponding Modbus TCP function. ~

1、MODBUS TCP 2)当 MODBUS TCP 报文地址


=(2 254)且与模块地址不冲突时,对应
功能
2) when Modbus TCP message 254) and does not conflict with the
1. Modbus TCP address = (2 module address
features MODBUS TCP 转 MODBUS RTU 功能。
2、MODBUS TCP
502 转 2 Modbus TCP to Modbus RTU function.
2. Modbus to TCP 3)该端口两路连接时支持三类连接方式:
MODBUS RTU 功 3) the port supports three types of connections when it connects two ways:
能(此 A.两路同时对应 MODBUS TCP 功能或 MODBUS TCP 转 MODBUS
Modbus RTU RTU 功能
function (this A. The two channels correspond to Modbus TCP function or Modbus TCP
时对应 COM1) to Modbus RTU function at the same time
Time corresponds to B.1 路链接对应 MODBUS TCP、1 路链接对 MODBUS TCP 转
COM1) MODBUS RTU
B. 1 link corresponding to Modbus TCP, 1 link to Modbus TCP to
Modbus RTU
功能(具体由报文中从站的站号决定)。
Function (depending on the station number of the slave station in the
message).

1、MODBUS TCP
功能 1)当 MODBUS TCP 报文地址=模块地址时,对应 MODBUS TCP 功
1. Modbus TCP 能。
features 1) when the Modbus TCP PACKET ADDRESS = the module address,
2、MODBUS TCP corresponding Modbus TCP function.
转 2)当 MODBUS TCP 报文地址=(2~254)且与模块地址不冲突时,对
2. Modbus to TCP 应 COM2
MODBUS RTU 功 2) when the Modbus TCP packet address = (2 ~ 254) and does not conflict
能(此 with the module address, it corresponds to COM2
Modbus RTU 口 MODBUS TCP 转 MODBUS RTU 功能。
9502 function (this 1 Modbus TCP port to Modbus RTU function.
时对应 COM2) 3)配置串口 2 为透传功能时候,该端口的 TCP 连接实现将 TCP 数
Time corresponds to 据
COM2) 3) configure serial port 2 for transmission when the TCP connection
3、TCP 透传功能 implementation for that port transfers TCP data
(此
3. TCP transmission
(this 透传给 COM2。
时对应 COM2) Transmission to COM2.
Time corresponds to
COM2)

1、MODBUS TCP
功能 1)当 MODBUS TCP 报文地址=模块地址时,对应 MODBUS TCP 功
1. Modbus TCP 能。
features 1) when the Modbus TCP PACKET ADDRESS = the module address,
2、MODBUS TCP corresponding Modbus TCP function.
转 2)当 MODBUS TCP 报文地址=(2~254)且与模块地址不冲突时,对
2. Modbus to TCP 应 COM2
MODBUS RTU 功 2) when the Modbus TCP packet address = (2 ~ 254) and does not conflict
能(此 with the module address, it corresponds to COM2
Modbus RTU
function (this
时对应 COM2)
Time corresponds to 口 MODBUS TCP 转 MODBUS RTU 功能。
9503 COM2) 1 Modbus TCP port to Modbus RTU function.
3、TCP 透传功能 3)配置串口 1 为透传功能时候,该端口的 TCP 连接实现将 TCP 数
(此 据
3. TCP transmission 3) configure the serial port 1 to transmit TCP data when the TCP
connection implementation for that port
(this
透传给 COM1。
时对应 COM1)
Pass through to COM1.
Time corresponds to
COM1)

1、MODBUS TCP 1)当 COM2 口模式为“MODBUS 主站”时,可将最多 6 个 MODBUS


控制 RTU
1. Modbus TCP 1) use up to 6 Modbus RTU when COM2 port mode is “Modbus Master”
control 从站与本模块,转换为与它们网页配置的 IO、保持/输入寄存器点数
多从站 From the station and this module, convert to IO, Hold/input register points
5502 Multi-station 1 configured with their web pages
对应的 1 个 MODBUS TCP 服务端控制。
The corresponding 1 Modbus TCP server side control.

7
www.amsamotion.com
Www.amsamotion. Com 7
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

3.2、ETH-MODBUS-IO16R 的串口功能对应表
3.2, ETH-MODBUS-IO16R serial port function table

 串口功能描述
Serial function description
最大
支持
Max
Support
连接
Conn
端口 ectin 详情描述
功能
Port g Detailed description
Function
数量
Quan
tity

1、上位机配置 COM1 为 TCP 转 RTU 功能时,COM1 可以连接其他


MODBUS
1. When the host computer is configured with COM1 as a TCP to RTU
function, COM1 can connect other Modbus
RTU 从站;实现以太网控制其他 MODBUS RTU 从站模块功能(对
应 TCP
1、MODBUS TCP RTU slave station; realization of Ethernet control of other MODBUS
转 RTU slave station module function (corresponding to TCP
1. Modbus to TCP 连接的 502 端口)。
MODBUS RTU 功能 Port 502) .
Modbus RTU
function
COM1 2、 2、上位机配置 COM1 为 RTU 功能时:
COM1 2 When the host computer is configured with COM1 as RTU function:
1)MODBUS RTU 功 1)当收到站号与本模块一致,其他 MODBUS RTU 主站可以通过
能 MODBUS
1) when the receiving station number is the same as this module, the other
1) Modbus RTU Modbus RTU main station can be accessed via Modbus
function RTU 协议访问本设备。
2)MODBUS RTU 转 RTU protocol access to the equipment.
2) Modbus RTU 2)当收到站号与本模块不一致,其他 MODBUS RTU 主站可以通过
本模
2) when receiving station number is inconsistent with this module, other
MODBUS TCP 功能 2 Modbus RTU main station can pass this module
Modbus TCP function 块访问 MODBUS TCP 服务器设备。
3、TCP 透传 Block Access Modbus TCP server device.
3. TCP transmission 3、配置 COM1 为透传功能时,COM1 与 9503 端口的 TCP 连接实现
数据
3. Configure COM1 for transmission, COM1 and 9503 port TCP
connection to implement data
透传(对应 TCP 连接的 9503 端口)。
Transmission through (the 9503 port corresponding to the TCP
connection).
1、上位机配置 COM2 为 TCP 转 RTU 功能时,COM2 可以连接其他
MODBUS
1. When the host computer is configured with COM2 to transfer TCP to
RTU, COM2 can connect other Modbus
RTU 从站;实现以太网控制其他 MODBUS RTU 从站模块功能(对
应 TCP
RTU slave station; realization of Ethernet control of other MODBUS
RTU slave station module function (corresponding to TCP
1、MODBUS TCP
转 连接的 9502/9503 端口)。
1. Modbus to TCP Port 9502/9503) .
2、上位机配置 COM2 为 RTU 功能时,其他 MODBUS RTU 主站可
MODBUS RTU 功能 以通过
Modbus RTU 2. When the host computer is configured with COM2 as RTU function,
function other Modbus RTU main stations can pass
2、MODBUS RTU
功能
2. Modbus RTU MODBUS RTU 协议访问本设备。
function The Modbus RTU protocol accesses the device.
3、配置 COM2 为透传功能时,COM2 与 9502 端口的 TCP 连接实现
数据
COM2 3、TCP 透传 3. Configure COM2 for transmission, COM2 and 9502 port TCP
COM2 3. TCP transmission 1 connection to implement data
4、MODBUS TCP
控制 透传(对应 TCP 连接的 9502 端口)。
4. Modbus TCP Transmission through (the 9502 port corresponding to the TCP
control connection).
4、配置 MODBUS 主站功能时,COM2 通过 5502 端口,可将最多 6
个 MODBUS
多从站 When configuring the Modbus master function, COM2 can carry up to 6
Multi-station Modbus through port 5502
RTU 从站与本模块,转换为与它们网页配置的 IO、保持/输入寄存器
RTU slave stations and this module are converted to IO, hold/input
registers configured with their pages
点数对应的 1 个 MODBUS TCP 服务端控制。(对应 TCP 连接 5502
端口)。
The number of points corresponds to 1 Modbus TCP server side control.
(corresponding to TCP connection port 5502).

 串口与端口号功能对应关系
Corresponding relationship between serial port and port number function
COM 口与 TCP 关系表
COM interface and TCP
relationship table
端口
MODBUS 主站转 MODBUS RTU
Port
MODBUS RTU Modbus master MODBUS TCP 转 转 TCP 转串口
Modbus RTU switch Modbus to TCP Modbus RTU to TCP serial port
MODBUS 透传
从站 TCP MODBUS RTU MODBUS TCP Through
Slave station Modbus TCP Modbus RTU Modbus TCP transmission
支持
COM1 支持 不支持
Support
COM1 Support No 502 (网页设置)
9503
(web settings)
COM2 支持 5502 端口 9502、9503 不支持
COM2 Support Port 5502 9502,9503 No 9502
8
www.amsamotion.com
Www.amsamotion. Com 8
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

3.3、端口数据缓冲区长度说明
3.3. Port data buffer length description
主站功能
TCP 透传 MODBUS 协议下 Main station
TCP transmission Under the Modbus protocol function
端口 接收数据 接收数据 接收数据 接收数据 从站数量
Port Receiving data Receiving data Receiving data Receiving data Number of slave
最大允许长度 最大允许长度 最大允许长度 最大允许长度 stations
Maximum Maximum Maximum Maximum
allowable length allowable length allowable length allowable length
COM1
COM1 512 512 240 240
6 路从站
COM2 Route 6 from the
COM2 512 512 240 240 station
TCP 连接
TCP
connection 512 512 512 512

3.4、数字输入地址
3.4. Numeric input address
输入通道 输入通道
Input PLC MODBUS Input PLC MODBUS
Channel PLC. Modbus Channel PLC. Modbus
序号 对应地址 对应地址 序号 对应地址 对应地址
Serial Correspondi Correspondin Serial Correspondi Correspondin
number ng address g address number ng address g address
0x00 0x08
1 10001 0x00 9 10009 0x08
0x01 0x09
2 10002 0x01 10 10010 0x09
0x02 0x0A
3 10003 0x02 11 10011 0x0A
0x03 0x0B
4 10004 0x03 12 10012 0x0B
0x04 0x0C
5 10005 0x04 13 10013 0x0C
0x05 0x0D
6 10006 0x05 14 10014 0x0D
0x06 0x0E
7 10007 0x06 15 10015 0x0E
0x07 0x0F
8 10008 0x07 16 10016 0x0F

注:支持0x02功能码


3.5、数字输出地址
3.5 digital output address
输入通道 输入通道
Input PLC MODBUS Input PLC MODBUS
Channel PLC. Modbus Channel PLC. Modbus
序号 对应地址 对应地址 序号 对应地址 对应地址
Serial Correspondi Correspondin Serial Correspondi Correspondin
number ng address g address number ng address g address
0x00 0x08
1 00001 0x00 9 00009 0x08
0x01 0x09
2 00002 0x01 10 00010 0x09
0x02 0x0A
3 00003 0x02 11 00011 0x0A
0x03 0x0B
4 00004 0x03 12 00012 0x0B
0x04 0x0C
5 00005 0x04 13 00013 0x0C
0x05 0x0D
6 00006 0x05 14 00014 0x0D
0x06 0x0E
7 00007 0x06 15 00015 0x0E
0x07 0x0F
8 00008 0x07 16 00016 0x0F

注:支持0x01、0x05、0x0F功能码



9
www.amsamotion.com
Www.amsamotion. Com 9
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

3.6、保持寄存器地址
3.6. Keep Register address
PLC 对应地址 支持
PLC MODBUS 对应地址(字) 默认值(十进制) Support
名称 corresponding Modbus corresponding Default value
功能码
Name address address (word) (decimal)
Function code
预留 40001~40008 0x00~0x07 0x03
Reserve 40001 ~ 40008 0x00 ~ 0x07 0x03

3.7、系统参数(上位机修改)
3.7. System parameters (modified by host computer)
MODBUS 对应地址(字)
名称 Modbus corresponding 默认值(十进制)
Name address (word) Default value (decimal)
预留 0x00
Reserve 0x00 100
预留 0x01
Reserve 0x01 1
本机地址配置
Local address 0x02
configuration 0x02 1
COM1 通信参数配置
COM1 communication 0x03 9600,1,8,NONE
parameter configuration 0x03 9600,1,8, NONE
帧结束时间 0x04
Frame end time 0x04 0
离散输入显示模式
Discrete input display
0x05
mode
0x05 0
切换
Switching
预留 0x06
Reserve 0x06 0
预留 0x07
Reserve 0x07 0
总线模式 0x08
Bus mode 0x08 401
本机 IP 段 1
Local IP segment 0x09
1 0x09 192.168
本机 IP 段 2
Local IP segment 0x0A
2 0x0A 1.12
本机 MAC1 0x0B
Native MAC1 0x0B 255.255
本机 MAC2 0x0C
Native MAC2 0x0C 255.255
本机 MAC3 0x0D
Native MAC3 0x0D 255.255
COM2 通信参数
COM2 communication 0x0E 9600,1,8,NONE
parameters 0x0E 9600,1,8, NONE

各串口模式配置
Configuration of serial 0X10
port modes 0X10 0

注意:修改保持寄存器参数后应将模块断电重启





10
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

四、产品功能
Product features

4.1、MODBUS TCP 功能
4.1 Modbus TCP features

MODBUS TCP 报文地址为模块地址时,将对本模块进行访问,即 MODBUS TCP 功能。


when the Modbus TCP message address is the module address, the module will be
accessed, namely Modbus TCP function.

MODBUS TCP 功能参数


Modbus TCP function parameters
类别 参数详情 说明
Categories Parameter details Account for
该 IP 为默认值,参考章节 5.2.2 或 5.3.2 设置其他 IP
TCP 服务器 IP 192.168.1.12 This IP is the default, refer to section 5.2.2 or 5.3.2 for
TCP Server IP 192.168.1.12 setting other IP
TCP 服务器端口 502、9502、9503 固定端口
TCP Server Port 502,9502,9503 Fixed port
出厂模块站号 1,可设置范围 1~126,参考章节 5.2.3
模块地址 1~126 Ex-factory module station number 1, set range 1 ~ 126,
Module address 1 ~ 126 reference section 5.2.3
4.2、MODBUS TCP 转 MODBUS RTU 功能
4.2. Modbus TCP to Modbus RTU function

直接将 MODBUS TCP 的请求转换为 MODBUS RTU 请求,并通过 RS485 口发送给从站;


The request of Modbus TCP is directly converted to Modbus RTU request and sent to
slave station through RS485 port

然后将对应的从站应答数据转换为 MODBUS TCP 报文发送给上位机,相关参数见下表。


The corresponding slave station response data is then converted into Modbus TCP
messages and sent to the host computer. The relevant parameters are shown in the
table below.

MODBUS TCP 转 MODBUS RTU 功能参数


Modbus TCP to Modbus RTU function parameters
参数详情
Parameter details
类别 说明
Categories COM1 COM2 Account for
COM1 COM2
TCP 服务器 IP 192.168.1.12 该 IP 为默认值,参考章节 5.2.2 或 5.3.2 设置其他 IP
TCP Server IP 192.168.1.12 This IP is the default, refer to section 5.2.2 or 5.3.2 for
setting other IP

固定端口,其中 502 端口可最多支持 2 路上位机链接


TCP 服务器端口 9502、9503 Fixed port, of which port 502 can support up to 2-way PC
TCP Server Port 502 9502,9503 Link
出厂默认模式,可通过章节 4.7 或章节 5.2.5 设置
串口模式 TCP 转 RTU The factory default mode can be set by section 4.7 or
Serial mode TCP to RTU section 5.2.5
MODBUS RTU 从 连接到本机的 RS485 口的 MODBUS 从机地址必须在
站 2~254
Modbus RTU slave Modbus from port RS485 connecting to this machine must
2~254
station be at 2 ~ 254
地址 2 ~ 254 范围内,且不与本模块地址冲突
Address And does not conflict with the module address
默认参数:
Default parameters:
RS485 串口参数 波特率:9600,8 位数据,参考章节 5.2.4 或 5.3.4 设置其他串口参
数无校验,1 位停止位
RS485 serial port parameters, baud rate: 9600,8-bit data, reference section 5.2.4 or
5.3.4 set other serial port parameters without calibration, 1-bit stop

11
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

4.3、MODBUS RTU 转 MODBUS TCP 功能


4.3. Modbus RTU to Modbus TCP function

本模块 COM1 口支持将 MODBUS RTU 报文转换为 MODBUS TCP 报文;实现

MODBUS RTU 主站与 MDOBUC TCP 服务器间的数据转换。当 COM1 口为“RTU”模式

时,模块自动启动 MODBUS TCP 客户端功能,自动连接通过网页设置的远程 MODBUS

TCP 服务器。相关参数说明见下表:

The module COM1 supports Modbus RTU message to be converted to TCP

message, and realizes data conversion between Modbus RTU main station and

MDOBUC TCP server. When the COM1 port is in “RTU”mode, the module

automatically starts the MODBUS TCP client function and automatically connects to

the remote Modbus TCP server set up through the web page. A description of the

relevant parameters is given in the following table:

MODBUS RTU 转 MODBUS TCP 功能参数


Modbus RTU to Modbus TCP functional parameters
参数详情
Parameter details
类别 说明
Categories COM1 Account for
COM1
该 IP 与端口为出厂默认参数,参考章节 5.3.3 设置其
远端服务器 IP 192.168.1.124 The IP and port are factory default parameters, which are
Remote Server IP 192.168.1.124 set by reference to Section 5.3.3
他远程服务器 IP 与端口
远端服务器端口 He’s on a remote server with an IP port
Remote server port 8080
串口模式 RTU 参考章节 5.2.5 设置串口模式为 RTU
Serial mode RTU Reference Section 5.2.5 sets the serial port mode to RTU
默认参数:
Default parameters:
RS485 串口参数 参考章节 5.2.4 设置其他串口参数
RS485 serial port 波特率:9600,8 位数据, Refer to section 5.2.4 for setting additional serial port
parameter Baud rate: 9,600,8 digits, parameters
无校验,1 位停止位
No check, 1 stop bit

4.4、MODBUS RTU 功能
4.4. Modbus RTU

本模块 COM1 口和 COM2 口都支持 MODBUS RTU 功能。当 COM1 或 COM2 口为“RTU”
The module COM1 and COM2 both support Modbus RTU function. When COM1 or
COM2 ports are “RTU”

模式时,本模块可作为 MODBUS RTU 从站设备使用。相关参数说明见下表:


In Modbus mode, the module can be used as Modbus RTU slave equipment. A
description of the relevant parameters is given in the following table:

MODBUS RTU 功能参数


modbus RTU functional parameters
类别 参数详情 说明
Categories Parameter details Account for

1)本模块站号可参考章节 5.2.3 设置
1) refer to section 5.2.3 for station numbers for this module
MODBUS RTU 从 2)当 COM1 口收到站号与本模块一致时,则当作
站 MODBUS
Modbus RTU slave 2) when the receiving station number of COM1 port is the
station 1~126 same as this module, it is used as Modbus
1 ~ 126 RTU 报文处理;反之,则将 MODBUS RTU 报文转为
MODBUS
地址 On the contrary, Modbus RTU message is converted to
Address Modbus
TCP 处理,即章节 4.3 所述功能。
TCP processing, as described in section 4.3.
串口模式 RTU 参考章节 5.2.5 设置串口模式为 RTU
Serial mode RTU Reference Section 5.2.5 sets the serial port mode to RTU
默认参数:
Default parameters:
RS485 串口参数 参考章节 5.2.4 设置其他串口参数
RS485 serial port 波特率:9600,8 位数据, Refer to section 5.2.4 for setting additional serial port
parameter Baud rate: 9,600,8 digits, parameters
无校验,1 位停止位
No check, 1 stop bit
12
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

4.5、MODBUS TCP 控制多从站功能


4.5. Modbus TCP control multiple slave function

4.5.1、功能说明
4.5.1

本模块的 COM2 口支持 MODBUS RTU 主站功能,本功能用于将连接在 COM2 口的至


The module’s COM2 port supports Modbus RTU main station function, this
function is used to connect in the COM2 port to

多 6 个 MODBUS RTU 从站及本模块的 IO 点数转换为 1 个 MODBUS TCP 服务端,通过 1


6 Modbus RTU slave stations and IO points of this module are converted into 1 TCP
server through Modbus 1

个 MODBUS TCP 连接即可实现全部从站的读写处理。


All slave stations can be read and write by Modbus TCP connection.

按原站号大小关系,自动映射为 MODBUS TCP 对应的寄存器区域,模块寄存器地址最前

(模块地址为 2~7 与 RTU 站号“冲突”时,仍保持在前),其余低站号寄存器地址在前。

According to the size relation of the original station number, the register area of

Modbus TCP is mapped automatically, the module register address is the first (when the

module address is 2 ~ 7 and RTU station number “Conflict”, it still remains in the

front) , the other low station number register address is in the front.

MODBUS RTU 主站功能参数


Function parameters of Modbus RTU master station
类别 参数详情 说明
Categories Parameter details Account for

串口编号 COM2
Serial number COM2
该 IP 为默认值,参考章节 5.2.2 或 5.3.2 设置其他 IP
TCP 服务器 IP 192.168.1.12 This IP is the default, refer to section 5.2.2 or 5.3.2 for
TCP Server IP 192.168.1.12 setting other IP
TCP 服务器端口 固定端口
TCP Server Port 5502 Fixed port
出厂模块站号 1,可设置范围 1~126,参考章节 5.2.3
模块地址 1~126 Ex-factory module station number 1, set range 1 ~ 126,
Module address 1 ~ 126 reference section 5.2.3
其余 MODBUS
RTU
Rest of Modbus 2~7 MODBUS RTU 从站站号必须为 2~7 号
RTU 2~7 The Slave Station number of Modbus RTU must be 2 ~ 7
从站地址
From station
address
MODBUS RTU 从

Modbus RTU slave
station 本模块为 MODBUS TCP 服务端
最大数量 6 This module is Modbus TCP server
Maximum quantity
串口模式 MODBUS 主站 参考章节“5.3.4-开启主站模式”设置
Serial mode Modbus master Refer to the section “5.3.4-enable master mode”settings
默认参数:
Default parameters:
COM2 串口参数 COM2 串口参数修改参考章节 5.2.4,
COM2 serial port 波特率:9600,8 位数据, COM2 serial port parameter modification reference section
parameter Baud rate: 9,600,8 digits, 5.2.4,
无校验,1 位停止位 所有从站串口参数应一致
All slave station serial port parameters should be consistent
No check, 1 stop bit

4.5.2、功能配置
4.5.2

将 COM2 模式设为 MODBUS RTU 主站(参考章节“5.3.4-开启主站模式”),并在网


页配置对应从站的点数后(参考章节 5.3.4-MODBUS TCP 控制多从站通讯配置),模块的
The COM2 mode is set to Modbus RTU master station (reference section
“5.3.4-open master station mode”) and the module is configured after the web
page corresponds to the number of slave stations (reference section 5.3.4-MODBUS
TCP control multi-slave station communication configuration)

COM2 就自动启动 MODBUS RTU 主站定时扫描。


COM2 will automatically start Modbus RTU master station timing scanning.

13
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

4.5.3、功能测试
4.5.3 functional testing

将各串口参数一致的 MODBUS RTU 从站以手拉手总线正确连接至模块的 COM2 口后,

可 使 用 艾 莫 迅 针 对 该 功 能 提 供 的 专 用 测 试 工 具 ”AMX_ModbusTCP 测 试 工 具 “ ( 版 本

V1.0),按下列步骤进行测试:

After correctly connecting the Modbus RTU slave station with hand-in-hand bus

to the module’s COM2 port with the same serial port parameters, we can use AMX

test tool (version V1.0) provided by imoxun to test the module by following steps:

A. 填写模块地址,本模块出厂默认 IP 为 192.168.1.12
Fill in the module address, this module factory default IP 192.168.1.12

B. 填写端口号 5502(默认,其他功能连接时可更改)
Fill in port number 5502(by default, can be changed when other functions are
connected)

C. 填写数字输出个数、数字输入个数、只读寄存器个数、保持寄存器个数(根据模块 IP
Fill in number of digital output, number of digital input, number of read-only
registers, number of hold registers (according to module IP

网页配置的 6 个 RTU 从站总点数,参考章节 5.3.4-MODBUS TCP 控制多从站通讯配置)


Refer to section 5.3.4-MODBUS TCP control multi-slave communication
configuration)

D. 填写模块地址(1~126),出厂时本模块地址为 1
Fill in the module address (1 ~ 126) , the factory when the module address is 1

E. 点击设置按钮
Click the settings button

F. 点击启动第 2 路 MODBUS TCP 按钮(连接后按钮颜色变为红色)


Click on the Modbus TCP button to start channel 2(the button will turn red when
connected)

G. 检查数字输入、线圈、输入寄存器、保持寄存器 4 个区域状态数值,是否与从站对应
Check digital input, Coil, input register, hold register 4 regional state values,
whether corresponding to slave
注意:

选择第一路MODBUS TCP连接测试也可,但注意端口号需修改为
5502两路MODBUS TCP连接均设置时,个数将相加,第2
路连接的地址在前本模块的保持寄存器不支持5502端口读取或写












14
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

4.6、TCP 转 RS485 透传功能


4.6. TCP to RS485 transmission

本模块 COM1 口和 COM2 口都支持 TCP 透传功能。当 COM1 或 COM2 口为“TCP 透


Both COM1 port and COM2 port of this module support TCP transmission function.
When COM1 or COM2 ports are “TCP through

传”模式时,TCP 客户端数据将原样发送给连接模块的 RS485 设备。相关参数说明见下表:


In the “Transfer”mode, the TCP client data is sent as is to the RS485 device of the
connection module. The relevant parameters are described in the following table:

TCP 转 RS485 功能参数


TCP to RS485 function parameter
参数详情
Parameter
类别 details 说明
Categories Account for
COM1 COM2
COM1 COM2
该 IP 为默认值,参考章节 5.2.2 或 5.3.2 设置其他 IP
TCP 服务器 IP 192.168.1.12 This IP is the default, refer to section 5.2.2 or 5.3.2 for
TCP Server IP 192.168.1.12 setting other IP
TCP 服务器端口 固定
TCP Server Port 9503 9502 Immobilizes
TCP 透

TCP 参考章节 5.2.5 设置串口模式为 TCP 透传
串口模式 transmiss Refer to section 5.2.5 for setting the serial mode for TCP
Serial mode ion transmission
默认参数:
Default
parameters:
RS485 串口参数 参考章节 5.2.4 设置其他串口参数
RS485 serial port 波特率:9600,8 位数据, Refer to section 5.2.4 for setting additional serial port
parameter Baud rate: 9,600,8 digits, parameters
无校验,1 位停止位
No check, 1 stop bit

4.7、按键恢复出厂设置功能
4.7. Press the button to restore factory settings

在模块上电且 RUN 灯闪烁时,按住复位按钮(大约 5S)直到 RUN 灯变常亮后松开按钮,


When the module is powered up and the RUN lamp blinks, hold down the reset
button (about 5s) until the RUN lamp is turned on and the button is released,

RUN 灯常亮 5S 后恢复闪烁,再将模块断电至少 3S 后上电,模块即恢复出厂参数,如下表。


Run lights always on for 5s after the resumption of flashing, and then power-off
module at least 3s after power-on, the module is to resume factory parameters, as
follows table.
参数名称 参数默认值
Parameter name Parameter default

模块 IP 地址 192.168.1.12
Module IP address 192.168.1.12
出厂时为 1,使用后为 DIP2 拨码开关对应 1~32 站号,参考章节 5.2.3
模块地址 Factory when 1, use for DIP2 dial switch corresponding to 1 ~ 32 station number,
Module address reference section 5.2.3

波特率 9600,8 位数据位,1 位停止位,无校验;


Baud rate 9600,8 bits, 1 stop bit, no check;
串口通讯参数 其中 COM2 口波特率出厂时为 9600,使用后为 DIP1 拨码开关对应波特率,
Serial communication The baud rate of COM2 port is 9600 when manufactured and DIP1 dial switch
parameter corresponds to baud rate after use,
参考“章节 6.2.4-COM2 波特率设置”
Refer to “Section 6.2.4-COM2 baud rate settings.”

串口模式 COM1、COM2 串口模式均为 MODBUS TCP 转 MODBUS RTU


Serial mode COM1 and COM2 serial port modes are Modbus TCP to Modbus RTU
总线错误模式 模式为总线错误复位,判定总线错误时间阀值为 2s
Bus error mode The mode is bus error reset, and the threshold of bus error time is 2s
远程服务器 IP 地址:192.168.1.124,端口:8080
Remote Server IP Address: 192.168.1.124, Port: 8080
模块 IP 网页上“1 号站~6 号站”的线圈元件、离散元件、只读寄存器、
MODBUS TCP 控制 Module IP page “Station 1 ~ Station 6”coil components, discrete components, read-
Modbus TCP control only registers,
多从站通讯配置
Multi-slave
communication 读写寄存器的个数均为 0
configuration The number of read and write registers is 0

15
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

五、参数配置
Configuration of parameters

本章节针对 ETH-MODBUS-IO16R 的参数配置进行介绍,用户可选择艾莫迅 MODBUS 调

试工具(有时需要结合 DIP 拨码开关)或模块的 IP 网页进行配置,以实现相应功能需求。

This section introduces the parameter configuration of ETH-MODBUS-IO16R, users

can choose Modbus DIP debugging tool (sometimes need to combine with dial code

switch) or IP pages of module to configure, to achieve the corresponding functional

requirements.

5.1、配置前准备
5.1. Preconfiguration

 使用 10/100Mbps 网线连接模块和电脑
Connecting module and computer using 10/100Mbps network cable

 将 DC 24V 外部电源接入模块并通电,通电前请检查电源正负极是否连接正确
Connect the external power supply of DC 24V to the module and electrify it. Before
electrify, please check whether the positive and negative poles of the power
supply are connected correctly

 通过 ping 电脑与模块 IP 地址,检查电脑与模块的 IP 是否在同一局域网网段,如果
ping 通即可正常使用,如未 ping 通,可按以下情况处理:
By Ping the computer and the module IP address, check whether the computer and
the module IP in the same local area network segment, if Ping can be normal use,
if not ping, can be handled as follows:

情况1:初次使用,模块未更改过 IP



A.初次使用时,模块 IP 为默认地址:192.168.1.12,打开电脑网络连接,查看与模块对

应的本地网线 IP 是否与模块 IP 同一网段,如是,请检查网线是否良好,如不在同一网段,

可参照下一步骤 B 处理;
A. When first used, the module IP is the default address: 192.168.1.12, open the

computer network connection and check whether the local network IP

corresponding to the module is in the same network segment as the module IP, if so,

please check whether the network cable is good, if not in the same network

segment, can refer to the next step B processing;

B.参照下图步骤,将连接模块与电脑的网线网络,设置成与模块同一网段的固定 IP。
B. Refer to the following steps, connect the module and computer network cable,
set up with the module with the same network segment of the fixed IP.

16
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

情况2:已更改过模块IP:


A.用户记得模块 IP 时,请参考情况 1 中 B 操作内容,设置电脑 IP 与模块同一网段;


A. When the user remembers the module IP, please refer to the B operation
content in case 1, set the computer IP and the module the same network segment;

B.用户忘记模块 IP 时,按章节 4.7 内容复位模块 IP,然后参考情况 1 内容处理。


B. When the user forgets the module IP, reset the module IP by section 4.7, then
refer to case 1 for content handling.

5.2、使用“艾莫迅 MODBUS 调试工具”配置


5.2. Configuration using the Modbus debugging tool for imox

5.2.1、调试工具的连接
5.2.1 connection of debugging tools

艾莫迅 MODBUS 调试工具(版本 V3.0)的使用(配置或调试功能)与其他上位机一样,


需要建立上位机与模块的通讯,请按照以下步骤进行配置工具的连接:
The use (configuration or debugging) of the Modbus debugging tool (version
V3.0) , like any other host computer, requires communication between the host
computer and the module. Please follow these steps to configure the connection of
the tool:
A. 打开配置工具,在“接口型号”栏选择“MODBUS TCP+”
Open the configuration tool and select Modbus TCP + in the interface type
column

B. 选择对应的产品类别(主机型号),本主机为 I16-Q16
Select the corresponding product category (host model) , this host for I16-Q16

C. 填写模块地址(1~126),出厂时本模块地址为 1
Fill in the module address (1 ~ 126) , the factory when the module address is 1

D. 填写模块 IP 地址,本模块出厂默认 IP 为 192.168.1.12


Fill in the module IP address, this module factory default IP 192.168.1.12

E. 填写端口号 502(连接 9502、9503 端口不可用于配置模块参数)


Fill in port number 502(connection ports 9502 and 9503 can not be used to
configure module parameters)

17
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

F. 点击开始扫描按钮,成功连接后按钮文字变为停止扫描,其右边通讯状态图标颜色
将由黑色变为红色
Click the start scan button, after successfully connecting the button text to stop
scanning, its right communication status icon color will change from black to
red

5.2.2、修改本机 IP
5.2.2, modify native IP

在“以太网设置”区域填写所需模块 IP 地址后,点击同一水平线位置的“设置”按钮,
After filling in the required module IP address in the Ethernet settings area, click
the settings button at the same horizontal line,

RUN 灯常亮 5S 后恢复闪烁,再将模块断电至少 3S 后上电,新设置 IP 即生效。


Run lights always on for 5s after the resumption of flashing, and then the module
power at least 3s after power, the new set IP will take effect.
注意:不支持修改模块端口号


18
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.2.3、修改本机地址
5.2.3, modify the local address

 设置 1~32 站号
Set station number 1 ~ 32
修改站号的范围在 1~32,必须通过调整模块上“站地址”拨码开关的状态设置,注意当
Modification station number range in 1 ~ 32, you must adjust the module on the
“Station address”dial switch state settings, note when

模块上电时调整拨码状态时,需将模块断电至少 3S,再上电方可生效。具体对应关系如下表
When the power-on module is adjusted, the power-off module should be at least 3s
before power-on to take effect. Specific correspondence is shown in the table below

中所示(出厂时所有拨码为 OFF)。
(all outgoing dials are OFF) .
19
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 设置 33~126 站号
Set station 33 ~ 126
本模块可设置的最高站号为 126,当“站地址”拨码开关的所有状态为 ON 时(即设置前
The maximum station number that this module can set is 126, when all states of the
“Station address”dial switch are ON (that is, before setting

模块站号为 32),方可通过调试工具给模块设置 33~126 之间的站号。


Module station number is 32) , through the debugging tool to set the module
between 33 ~ 126 station number.

如下图所示,在“配置从机地址”区域填写所需设置的模块地址后,点击右方同一水平线
As shown in the figure below, after filling in the “Configure slave address”area
with the module address you want to set, click the same horizontal line on the right

位置的“设置”按钮,再将模块断电至少 3S 后上电,新设置模块地址即生效。
Location of the “Settings”button, and then the module power off at least 3s after
power, the new settings module address will take effect.

5.2.4、修改 COM 口参数


5.2.4, modify COM port parameters

 COM 口的通讯参数说明
Description of COM port communication parameters

COM 口通讯参数类型
COM port communication
parameter type

串口编号
Serial
number 波特率 数据位 停止位 校验位
Baud rate Data bit Stop bit Check bit

4800~115200 8或7位 None/Odd/Even


4800 ~ 115200 Eight or seven None/Odd/Even
(7 位数据位时,不支持
仅支持上位机设置 (仅 TCP 透传可设置 7 位) None)
COM1 Support PC settings (only TCP transmission can 1/1.5/2 (None is not supported for 7-bit
COM1 only be set to 7 bits) 11.52 data bits)
4800~115200 8或7位 None/Odd/Even
4800 ~ 115200 Eight or seven None/Odd/Even
(7 位数据位时,不支持
仅支持拨码开关设置 (仅 TCP 透传可设置 7 位) None)
COM2 Only dial switch (only TCP transmission can 1/1.5/2 (None is not supported for 7-bit
COM2 settings are supported be set to 7 bits) 11.52 data bits)

20
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 COM2 的波特率设置
COM2’s baud rate setting

COM2 的波特率由模块上的“波特率”拨码开关状态决定,注意当模块上电时调整拨码状
The baud rate of COM2 is determined by the “Baud rate”dial switch state on the
module. Note that the dial shape is adjusted when the module is powered on

态时,需将模块断电至少 3S,再上电方可生效。具体关系可见下表(出厂时所有拨码为 OFF)。


When the power is on, the module must be powered off for at least 3s before it can take
effect. The relationship can be seen in the following table (all dials are OFF at factory
time) .

 COM 口参数设置说明(除 COM2 波特率外)


Description of Com port parameter setting (except COM2 baud rate)

如下图所示,在“以太网转 485 配置”区域,从下拉清单中选择对应串口的通讯参数后

(串口 1 即 COM1 口、串口 2 即 COM2 口),点击右方同一垂直线位置的“设置”按钮,

RUN 灯常亮 5S 后恢复闪烁,再将模块断电至少 3S 后上电,新设置串口参数即生效。

As shown below, in the “Ethernet to 485 configuration”area, after selecting the

corresponding serial port communication parameters from the drop-down list (serial

1 is COM1, serial 2 is COM2) , click the “Settings”button at the same vertical line

on the right, run lights always on for 5s after the resumption of flashing, and then

the module power at least 3s after power, the new set of serial parameters will take

effect.
注意:

设置数据位7需要串口模式为TCP透传时(串口模式设置见章节5.2.5)



设置数据位7时,校验位不支持无校验(None)



21
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.2.5、修改串口模式
5.2.5. Modify serial port mode

如下图所示,在“串口模式设置”区域,从下拉清单中选择对应串口的模式后(串口 1 即
In the serial mode settings area, select the mode corresponding to the serial port
from the drop-down list (serial 1 is

COM1 口、串口 2 即 COM2 口),点击右方同一水平线位置的“设置”按钮,RUN 灯常亮


COM1 port, serial port 2 that COM2 port) , click the same horizontal line on the right of
the location of the “Settings”button, RUN light always on

5S 后恢复闪烁,再将模块断电至少 3S 后上电,新设置串口模式即生效。
5 s, then power off the module for at least 3s, then power on, the new set of serial
mode will take effect.

注意:对于MODBUS主站模式,串口1暂不支持,串口2需在网页设置。





5.2.6、修改总线掉电保持
5.2.6, modify the bus power down to maintain

总线错误的判断功能主要用于在连接本模块的通讯出现总线错误后,决定本模块的所有
输出线圈状态是继续保持,或是复位为线圈关断状态。
Bus error detection function is mainly used to determine whether all output coil
states of this module should be maintained or reset to coil off state after a bus error
occurs in the communication connected to this module.

模块支持 MODBUS TCP 客户端 502、9502、9503、5502 四路端口,以及 COM1 与

COM2 接口的两路 MODBUS RTU 主站连接本模块,当以上六路连接中至少一路连接本模

块的通讯正常时,总线通讯即正常,当 MODBUS TCP 客户端或者 MODBUS RTU 主站与本

模块之间通讯无一路连接并超过一定时间时,总线通讯即判断错误。

The module supports four ports of Modbus TCP client 502,9502,9503,5502, and

two Modbus RTU master terminals of COM1 and COM2. When the communication

of this module is normal, the bus communication is normal, when the

communication between Modbus TCP client or Modbus RTU master station and this

module is not connected and has been over a certain time, the bus communication

will be judged wrong.

22
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

用户可通过“艾莫迅 MODBUS 调试工具”设置总线错误模式(复位或保持)、总线错误


The user can set the bus error mode (reset or hold) and the bus error through the
Modbus debugging tool

判定时间(阀值)。如下图所示,在“模式配置”区域,根据需求进行总线错误复位或者总线
Decision time (threshold). As shown in the figure below, in the pattern configuration
area, perform bus error reset or bus as required

错误保持的勾选,以及在判定总线错误时间阀值(单位 10ms)处填入数值(即 MODBUS TCP


Check the error hold, and fill in the value (in 10ms) that determines the bus error time
threshold (Modbus TCP)

客户端或者 MODBUS RTU 主站与本模块间无连接的时间超过这一设置数值后,判定为总线


If the time of no connection between the client or Modbus RTU main station and
this module exceeds this setting value, the bus is determined

错误),点击“设置”按钮,RUN 灯常亮 5S 后恢复闪烁,再将模块断电至少 3S 后上电,新


Error) , click the “Settings”button, RUN lights up after 5s resume flashing, and then
the module power off at least 3s after power, new

设置的总线错误模式和判定时间即生效。
The bus error mode and the decision time are set to take effect.

注意:

出厂或者按键复位时,模式为总线错误复位,总线错误判断时间阀值为2s
总线错误判断时间阀值设置范围为:2s~327.67s,设置值超出范围时默认 2ms








总线错误判定时间为持续时间,即当无连接时间未超过总线错误时间内再次连
接本模块后,判定时间待下次无连接开始从零秒计时。








 注意
Pay attention

 由于艾莫迅 MODBUS 配置工具刚开始扫描 6 秒钟内,处于较快频率获取模块当前参数状态,若此时

用户在选择需设置参数,未尽快点击相应设置按钮,容易恢复设置前参数导致需要重复操作。

Since the Modbus configuration tool is in the state of acquiring the current parameters of the

module at a relatively fast frequency within 6 seconds of the beginning of the scan, if the

user is selecting the parameters to be set at this time and does not click the corresponding

settings button as soon as possible, easy recovery of pre-set parameters results in repeated

operations.

 需要在模块断电前设置多个参数时,应在 RUN 灯恢复闪烁后,再设置下一个参数。
When you need to set more than one parameter before the module is powered off, you should
set the next parameter after the RUN lamp has resumed flashing.

 以上操作(除对输入\出口的操作)均支持掉电保存,切勿频繁操作,避免损坏模块,造成工作异常。
The above operation (except for the operation of the import and export) are supported power-
off save, do not frequent operation, avoid damage module, resulting in abnormal work.

23
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.3、网页配置
5.3. Web configuration

5.3.1、登陆模块 IP 网页
5.3.1. Login module IP page

打开浏览器输入模块的 IP(默认 IP 为 192.168.1.12)后进入登录页面,在登录账号与登


Open the browser input module IP (default IP is 192.168.1.12) after entering the
login page, login with the account

录密码处均填写“amx666”后,点击登录按钮,即可进入模块的参数页面,如下图所示。
After filling in “AMX666”in the password area, click the login button to access the
module’s parameters page, as shown in the figure below.
注意:仅在点击登录按钮后,读取模块当前参数。



24
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.3.2、模块 IP 设置
5.3.2 module IP settings

如下图所示,在参数页面“IP 地址”区域,将所需 IP 地址填入,然后点击保存并重启按


As shown in the figure below, in the “IP address”area of the parameters page,
fill in the IP address you want, then click save and restart

钮,至网页无法显示后,将模块断电至少 3S 后上电,新设置模块 IP 地址即生效。


Button, to the page can not be displayed, the module power off at least 3s after
power, the new settings module IP address will take effect.

注意:多次点击保存并重启设置IP无效时,请检查电脑物理内存是否够用。




25
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.3.3、远端服务器 IP 设置
5.3.3, remote server IP settings

COM1 口串口功能为 MODBUS RTU 转 MODBUS TCP 时,相关远端服务器参数,需由


The serial port function of COM1 port is Modbus RTU to Modbus TCP

模块 IP 网页设置。
Module IP page setup.

如下图所示,在参数页面”远端服务器 IP 地址“区域,将所需远端服务器 IP 地址、端口


As shown in the figure below, in the “Remote Server IP address”section of the
parameters page, the required remote server IP address, port, and

号填入,然后点击保存并重启按钮,至网页无法显示后,将模块断电至少 3S 后上电,新设置
No. Fill in, then click the save and restart button, to the page can not be displayed, the
module power off at least 3s after power up, new settings

远端服务器 IP 地址、端口号即生效。
The remote server IP address and port number take effect.
注意:远端服务器IP地址应注意与模块IP在同一网段。





26
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

5.3.4、COM2 口参数设置
5.3.4, COM2 port parameter setting

 COM 口串口参数(除波特率外)
COM serial port parameters (except baud rate)

如下图所示,在参数页面”串口参数“区域,从下拉清单中选择对应 COM2 口的通讯参


As shown in the figure below, in the “Serial port parameters”section of the
parameters page, select the corresponding COM2 port communication
parameters from the drop-down list

数后,然后点击同一水平线位置的“确定”按钮,或点击保存并重启按钮,至网页无法显示后,
Then click the “OK”button at the same horizontal line, or click the save and restart
button until the page can not be displayed,

将模块断电至少 3S 后上电,新设置 COM2 串口参数即生效。


Power off the module for at least 3s, then the new set of COM2 serial port
parameters will take effect.
注意:

设置数据位7需要串口模式为TCP透传时(串口模式设置见章节5.2.5或下一




小节“开启主站功能”内容)
Section “Enable master function”)
设置数据位7时,校验位不支持无校验(None)



27
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 开启主站功能
Turn on the main station

如下图所示,在参数页面”开启主站功能“区域,从下拉清单中可选择对应 COM2 口的
As shown in the figure below, in the “Enable master”area of the parameters
page, from the drop-down list you can select the corresponding COM2 port

串口模式,然后点击保存并重启按钮,至网页无法显示后,将模块断电至少 3S 后上电,新设
Serial mode, then click the save and restart button, to the page can not be displayed,
the module power off at least 3s after power up, new

置 COM2 串口模式即生效。
set COM2 serial mode to take effect.

注意:COM2 口的其他串口模式,也可通过此处下拉清单中选择设置




28
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 MODBUS TCP 控制多从站通讯配置


Modbus TCP controls the configuration of multi-slave communication

如下图所示,在参数页面”2 号站~7 号站“区域,填写对应站号“线圈元件、离散元件、


As shown in the figure below, in the “Station 2 ~ Station 7”area of the parameter
page, fill in the corresponding station number “Coil element, discrete element,

只读寄存器、读写寄存器”的个数,然后点击右下角确定,或点击保存并重启按钮,至网页无
Read-only registers, read-write registers”, and then click the lower right-hand corner
to determine, or click the save and restart button, to the page without

法显示后,将模块断电至少 3S 后上电,新设置 MODBUS TCP 控制多从站通讯配置即生效。


After the method is displayed, power up the module at least 3s after power-off, the
newly set MODBUS TCP control multi-slave station communication configuration is
effective.

注意:要MODBUS TCP控制多从站可用,还需将COM2口模式设置为RTU主
站。





 注意
Pay attention

 以上操作(除对输出\入口的操作)均支持掉电保存,切勿频繁操作,避免损坏模块,造成工作异常。
The above operation (except for the operation of the input and output) are supported power-off
save, do not frequent operation, to avoid damage module, resulting in abnormal work.

29
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

六、MODBUS TCP 报文格式说明


Format specification of Modbus TCP message

6.1、数字量输入信号采集命令
6.1, digital input signal acquisition command

 协议说明
Protocol statement

功能码:0x02
Function code: 0x02

该命令用于读出当前离散输入寄存器状态;本机离散输入寄存器 0x00-0x0F 对应输入通道


This command is used to read the current discrete input register status; the native
discrete input register 0x00-0x0F corresponds to the input channel

1-16,当输入口状态为无效时,指示灯灭,返回 0;有效时,指示灯亮,返回 1。
1-16, when the input state is invalid, the indicator lights out, return 0; valid, the
indicator lights up, return 1.

 读离散输入请求报文格式说明
Read the format description of the discrete input request message

读离散输入请求(MODBUS TCP 报文格式)


Read discrete INPUT REQUEST -MODBUSDTCP TCP packet format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前 一般是报文序号
Transaction High Byte It’s usually a message
1 identification 2 first serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x02 MODBUS 通讯协议的相关功能码
5 Function code 1 0x02 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte 从该寄存器地址开始读输入离散量
6 address 2 first Read the input discrete quantity from the register address
寄存器个数 高字节在前
Number of High Byte
7 registers 2 first

 读离散输入应答报文格式说明
Read the format specification for discrete input reply messages

读离散输入应答(MODBUS TCP 报文格式)


Read the discrete input reply (Modbus TCP message format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 identification 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x02 MODBUS 通讯协议的相关功能码
5 Function code 1 0x02 The related function code of Modbus communication protocol
数据长度 假设数据长度值为 N,单位:字节
6 Data Length 1 Assume the data length value is N, in bytes
本机站号时对应 8 位离散输入,数据从低位到高位对应离散

The station number of this machine corresponds to 8 bits discrete
低字节在前 input, and the data from low to high bits corresponds to discrete
数据 Low Byte input
7 Data N first 入 1~8 通道,每个字节高位在前
Enter 1 ~ 8 channels, each byte higher than the first
30
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 示例报文说明
Example message description

读取本机的 1~16 输入通道状态,示例中输入通道 2、8 有效


Read the 1 ~ 16 input channel status of the machine. In the example, the input
channels 2 and 8 are valid

请求报文:
Request message:
00 06 00 00 00 06 01 02 00 00 00 08
000600000006010200000008

应答报文
Reply message
00 06 00 00 00 04 01 02 01 82
000600000004010201

读取 2 号从站的 1~16 输入通道状态,示例中 2 号从站的输入通道 4、6、9、15 有效


Reads the 1-16 Input Channel status of No. 2 slave station. In the example, input
channels 4,6,9,15 of No. 2 slave station are valid

请求报文:
Request message:
00 06 00 00 00 06 02 02 00 00 00 10
000600000006020000010

应答报文
Reply message
00 06 00 00 00 05 02 02 02 28 41
0006000000050202022841

6.2、数字量输出信号采集命令
6.2, digital output signal acquisition command

 协议说明
Protocol statement

功能码:0x01
Function code: 0x01

该命令用于读出当前线圈寄存器状态;本机线圈寄存器 0x00-0x0F 对应数字量输出通道 1-16,


当输出口状态为无效时,指示灯灭,返回 0;有效时,指示灯亮,返回 1。
This command is used to read the current state of the coil register; the local coil
register 0x00-0x0F corresponds to the digital output channel 1-16, when the output
state is invalid, the indicator lights out, return 0; when valid, the indicator lights up,
return 1.

 读线圈输出状态的请求报文格式说明
Description of request message format for reading coil output status

读线圈状态请求(MODBUS TCP 报文格式)


Read coil status request (Modbus TCP message format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前 一般是报文序号
Transaction High Byte It’s usually a message
1 identification 2 first serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
高字节在前 度
报文长度 High Byte The data byte length of transaction identification, protocol
3 Message length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x01 MODBUS 通讯协议的相关功能码
5 Function code 1 0x01 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
寄存器个数 高字节在前
Number of High Byte
7 registers 2 first

31
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 读线圈输出应答报文格式说明
Description of the format of the read coil output reply message

读线圈状态应答(MODBUS TCP 报文格式)


Read the coil status reply (Modbus TCP message format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 identification 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
高字节在前 度
报文长度 High Byte The data byte length of transaction identification, protocol
3 Message length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x01 MODBUS 通讯协议的相关功能码
5 Function code 1 0x01 The related function code of Modbus communication protocol
数据长度 数据长 N 字节,则数据长度值为 N
6 Data Length 1 The data length is N bytes, the data length value is n
本机站号时对应 8 位线圈输出,数据从低位到高位对应离散

低字节在前 The station number corresponds to 8-bit coil output, and the data
数据 Low Byte from low to high bit corresponds to discrete transmission
7 Data 1 first 入 1~8 通道,每个字节高位在前
Enter 1 ~ 8 channels, each byte higher than the first

 示例报文说明
Example message description

读取本机的 1~8 通道的线圈状态,示例中线圈通道 2、8 有


效请求报文:
Read the local 1 ~ 8 channel coil status, the example
coil channel 2,8 valid request message:
00 01 00 00 00 06 01 01 00 00 00 08
Million, million

应答报文
Reply message
00 01 00 00 00 04 01 01 01 82
Million, 10101

读取 2 号从站的 1~16 通道输出线圈状态,示例中 2 号从站的输出通道 1、7、10、16 有


效请求报文:
Read the 1 ~ 16 channel output coil status of the No. 2 slave station. In the
example, the No. 2 slave station’s output channels 1,7,10,16 are valid
request messages:

00 01 00 00 00 06 02 01 00 00 00 10
Million, million

应答报文
Reply message
00 01 00 00 00 05 02 01 02 41 82
Million

6.3、数字量输出信号单个控制命令
6.3 digital output signal single control command

 协议说明
Protocol statement

功能码:0x05
Function code: 0x05

该命令用于控制单个线圈寄存器状态;本机线圈寄存器 0x00-0x0F 对应数字量输出通道 1-16,


当输出口状态为无效时,指示灯灭,返回 0;有效时,指示灯亮,返回 1。
This command is used to control the state of single coil register; the local coil register
0x00-0x0F corresponds to the digital output channel 1-16, when the output state is
invalid, the indicator light is turned off, return 0; when valid, the indicator light is
turned on, return 1.

32
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 写单个离散输出的请求报文格式说明
Write a request packet format specification for a single discrete output

写单个线圈请求(MODBUS TCP 报文格式)


Write a single coil request (Modbus TCP packet format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号
1 identification 2 first It’s usually a message serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
高字节在前 度
报文长度 High Byte The data byte length of transaction identification, protocol
3 Message length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x05 MODBUS 通讯协议的相关功能码
5 Function code 1 0x05 The related function code of Modbus communication protocol
高字节在前
写入地址 High Byte
6 Write address 2 first
高字节在前 写入 0XFF00 表示使能输出;
写入值 High Byte Write 0XFF00 to enable output;
7 Write value 2 first 写入 0X0000 表示停止输出;
Write 0X0000 to stop the output;

 写单个离散输出的应答报文格式说明
Write a format description of the reply message for a single discrete
output

写单个线圈应答(MODBUS TCP 报文格式)


Write a single coil reply (Modbus TCP message format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 recognition 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x05 MODBUS 通讯协议的相关功能码
5 Function code 1 0x05 The related function code of Modbus communication protocol
高字节在前
写入地址 High Byte
6 Write address 2 first
高字节在前 写入 0XFF00 表示使能输出;
写入值 High Byte Write 0XFF00 to enable output;
7 Write value 2 first 写入 0X0000 表示停止输出;
Write 0X0000 to stop the output;

 示例报文说明
Example message description

使能本机通道 1 的输出
Enables the output of local channel 1

请求报文:
Request message:
31 A6 00 00 00 06 01 05 00 00 FF 00
31a6000000601050000ff 00

应答报文
Reply message
31 A6 00 00 00 06 01 05 00 00 FF 00
31a6000000601050000ff 00

33
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

停止本机通道 1 的输出
Stops the output of local channel 1

请求报文:
Request message:
31 A6 00 00 00 06 01 05 00 00 00 00
31A600000060105000000000

应答报文
Reply message
31 A6 00 00 00 06 01 05 00 00 00 00
31A600000060105000000000

6.4、数字量输出信号多个控制命令
6.4. Digital output signal multiple control commands

 协议说明
Protocol statement

功能码:0x0F
Function code: 0x0F

该命令用于控制多个线圈寄存器状态;本机线圈寄存器 0x00-0x0F 对应数字量输出通道 1-16,


当输出口状态为无效时,指示灯灭,返回 0;有效时,指示灯亮,返回 1。
This command is used to control the state of multiple coil registers; the local coil
register 0x00-0x0F corresponds to the digital output channel 1-16, when the output
state is invalid, the indicator lights out, return 0; when valid, the indicator lights up,
return 1.

 写多个离散输出的请求报文格式说明
Write a request packet format specification for multiple discrete outputs

写多个线圈请求(MODBUS TCP 报文格式)


Write multiple coil requests (Modbus TCP packet format)
序号 长度 字节
Serial Length Byte
numb 报文字段 存放方式 说明
er Message Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前 一般是报文序号
Transaction High Byte It’s usually a message
1 identification 2 first serial number
2 协议标识 2 高字节在前 一般默认为 00 00
Protocol High Byte The default is 0000
identification first
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x0F MODBUS 通讯协议的相关功能码
5 Function code 1 0x0F The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
高字节在前
写入长度 High Byte
7 Write length 2 first
写入数据
Write data 假设写入数据字节数的值为 N
8 字节数 1 Suppose the number of bytes of data written is N
Number of
bytes
低字节在前 每个字节高位在前
写入数据 Low Byte Each byte is higher than
9 Write data N first the first

34
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 写多个离散输出的应答报文格式说明
Write format specifications for multiple discrete output reply packets

写多个线圈应答(MODBUS TCP 报文格式)


Write multiple coil responses (Modbus TCP message format)
序号 长度 字节
Serial 报文字段 Length Byte
numb Message 存放方式 说明
er Field (字节) Storage Account for
(bytes) mode
事务处理标识 高字节在前 一般是报文序号
Transaction High Byte It’s usually a message
1 identification 2 first serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x0F MODBUS 通讯协议的相关功能码
5 Function code 1 0x0F The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
高字节在前
写入长度 High Byte
7 Write length 2 first

 示例报文说明
Example message description

控制本机 1~8 通道的输出线圈状态,示例中使输出通道 1、3、6、8 有


效请求报文:
Controls the output coil status of channels 1-8 on this machine,
making output channels 1,3,6, and 8 valid request packets
in the example:
31 A6 00 00 00 08 01 0F 00 00 00 08 01 A5
31A600000008010F 00000801A 5

应答报文
Reply message
31 A6 00 00 00 06 01 0F 00 00 00 08
31A600000006010F 0000008

控制 254 号从站的 3~15 通道的 13 个输出线圈状态,示例中使输出通道 3、9、13、15 有


效请求报文:
Controls 13 output coil states for channels 3-15 of slave station 254, making output
channels 3,9,13, and 15 valid request packets in the example:

31 A6 00 00 00 09 FE 0F 00 02 00 0D 02 41 14
31a600000009fe 0F 0002000D 024114

应答报文
Reply message
31 A6 00 00 00 06 FE 0F 00 02 00 0D
31a600000006fe 0F 0002000D

6.5、输入寄存器读出命令
6.5 input register read out command

 协议说明
Protocol statement

功能码:0x04
Function code: 0x04

由于本机没有输入寄存器,因此该命令仅用于读出连接本机 RS485 接口的从站当前输入寄存


Since the machine does not have an input register, this command is only used to
read out the current input register from the slave station that connects to the
machine’s RS485 interface

器值。
Instrument value.

35
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

 读输入寄存器请求报文格式说明
Read Input Register request message format description

读离散输入请求(MODBUS TCP 报文格式)


Read discrete INPUT REQUEST -MODBUSDTCP TCP packet format)
长度 字节
序号 Length Byte
Serial 报文字段 存放方式
numb Message (字节) Storage 说明
er Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号
1 identification 2 first It’s usually a message serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x04 MODBUS 通讯协议的相关功能码
5 Function code 1 0x04 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
寄存器个数 高字节在前
Number of High Byte
7 registers 2 first

 读输入寄存器应答报文格式说明
Format description of read input register reply message

读离散输入应答(MODBUS TCP 报文格式)


Read the discrete input reply (Modbus TCP message format)
长度 字节
序号 Length Byte
Serial 报文字段 存放方式
numb Message (字节) Storage 说明
er Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 identification 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前 一般默认为 00 00
2 Protocol 2 High Byte The default is 0000
identification first
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x04 MODBUS 通讯协议的相关功能码
5 Function code 1 0x04 The related function code of Modbus communication protocol
数据长度 假设数据长度值为 N
6 Data Length 1 Suppose the data length value is n
低字在前 本机站号时即模拟量输入低通道在前;
The When the station number of this machine is the analog input low
lowercase channel in front;
数据 word comes
7 Data N first 每个寄存器数据占一个字的长度
Each register data occupies a word length

 示例报文说明
Example message description

读取 2 号从站的输入寄存器 30001~30006 地址数值,示例中 30001、30006 地址的数值为


Read the number of 30001 ~ 30006 address values in the input register of No. 2
slave station. In the example, the number of 30001,30006 addresses is

0x7531、0x7536。
0X7531,0X7536.

请求报文:
Request message:
00 04 00 00 00 06 02 04 00 00 00 06
000400000006020400000006

应答报文
Reply message
00 04 00 00 00 0F 02 04 0C 75 31 00 00 00 00 00 00 00 00 75 36
00000000000F 02040C 75310000000000000007536
36
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

6.6、保持寄存器读出命令
6.6. Keep the register read command

 协议说明
Protocol statement

功能码:0x03
Function code: 0x03

该命令仅用于读出连接本机 RS485 接口的从站当前保持寄存器值。


This command is only used to read out the current hold register values for slave
stations that connect to the native RS485 interface.

 读保持寄存器的请求报文格式说明
Read the format description of the request message for the hold register

读保持寄存器请求(MODBUS TCP 报文格式)


Read hold register request (Modbus TCP packet format)
长度 字节
序号 LengthByte
Serial 报文字段 存放方式
numb Message (字节) Storage 说明
er Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号
1 identification 2 first It’s usually a message serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x03 MODBUS 通讯协议的相关功能码
5 Function code 1 0x03 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
寄存器个数 高字节在前 本机站号时寄存器个数为 7,可读取模拟量输出通道当前数值
Number of High Byte Local station number when the number of registers is 7, can read
7 registers 2 first analog output channel current numerical value
 读保持寄存器的应答报文格式说明
Read the format description of the hold register reply message

读保持寄存器应答(MODBUS TCP 报文格式)


Read hold register reply (Modbus TCP message format)
长度 字节
序号 LengthByte
Serial 报文字段 存放方式
numb Message (字节) Storage 说明
er Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 identification 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x03 MODBUS 通讯协议的相关功能码
5 Function code 1 0x03 The related function code of Modbus communication protocol
数据长度 假设数据长度值为 N,单位:字节
6 Data Length 1 Assume the data length value is N, in bytes

37
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
Dongguan AMX Automation Technology ETH-MODBUS-IO16R module product
Co. , Ltd. manual

低字在前
The
lowercase
数据 word 每个寄存器数据占 1 个字的长度
7 Data N comes first Each register data takes 1 word in length

 示例报文说明
Example message description

读取 127 号从站的保持寄存器 40001~40006 通道数值,示例中 40001、40006 通道的数



Reads the hold register 40001 ~ 40006 channel values for slave station 127, the
40001,40006 channel values in the example

为 0x9C41、0x9C46。请求报文:
0x9C41,0X9C46. Request message:
00 17 00 00 00 06 7F 03 00 00 00 06
001700000067F 03000000006

应答报文
Reply message
00 17 00 00 00 0F 7F 03 0C 9C 41 00 00 00 00 00 00 00 00 9C 46
001700000000F 7F 030C 9C 410000000000000009C 46

6.7、写单个保持寄存器命令
6.7 write a single hold register command

 协议说明
Protocol statement

功能码:0x06
Function code: 0x06

该命令仅用于写入数值给连接本机 RS485 接口的从站保持寄存器。


This command is only used to write numeric values to a slave hold register that
connects to the native RS485 interface.

 写单个保持寄存器的请求报文格式说明
Write a request message format specification for a single hold register

写单个保持寄存器请求(MODBUS TCP 报文格式)


Write a single hold register request (Modbus TCP message format)
序号 报文字段 长度 字节
Serial Message Length Byte 说明
numb Field (字节) 存放方式 Account for
er (bytes) Storage
mode
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号
1 identification 2 first It’s usually a message serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
报文长度 高字节在前 除去事务处理标识、协议标识、以及报文长度的数字节长度
Message High Byte Removes transaction identification, protocol identification, and
3 length 2 first byte length of message length

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x06 MODBUS 通讯协议的相关功能码
5 Function code 1 0x06 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
高字节在前
寄存器值 High Byte
7 Register value 2 first

 写单个保持寄存器应答报文格式说明
Write a single hold register reply format specification

写单个保持寄存器应答(MODBUS TCP 报文格式)


Write a single hold register reply (Modbus TCP message format)
长度 字节
序号 Length Byte
Serial 报文字段 存放方式
numb Message (字节) Storage 说明
er Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 identification 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000

38
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
Dongguan AMX Automation Technology ETH-MODBUS-IO16R module product
Co. , Ltd. manual

除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

范围 0x01~0xFE;出厂本机为 1,其余用于 RS485 口的从机站


单元标识 号
Unit Range 0x01 ~ 0xfe; factory this machine for 1, the rest for RS485
4 identification 1 from the machine station number
功能码 0x06 MODBUS 通讯协议的相关功能码
5 Function code 1 0x06 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
高字节在前
寄存器值 High Byte
7 Register value 2 first

 示例报文说明
Example message description

设置 127 号从站的保持寄存器 40005 通道数值为 0x9C45。


Set the hold register 40005 channel value for slave 127 to 0x9C45.

请求报文:
Request message:
00 00 00 00 00 06 7F 06 00 04 9C 45
0000000000067F 0600049C 45

应答报文
Reply message
00 00 00 00 00 06 7F 06 00 04 9C 45
0000000000067F 0600049C 45

6.8、写多个保持寄存器命令
6.8. Write multiple hold register commands

 协议说明
Protocol statement

功能码:0x10
Function code: 0x10

该指令仅用于连续写多个数值给连接本机 RS485 接口的从站保持寄存器。


This instruction is only used to write multiple values consecutively to a slave hold
register that connects to the native RS485 interface.
 写多个保持寄存器请求报文格式说明
Write multiple hold register request packet format specification

写多个保持寄存器请求(MODBUS TCP 报文格式)


Write multiple hold register requests (Modbus TCP message format)
长度 字节
序号 LengthByte
Serial 报文字段 存放方式
numbe Message (字节) Storage 说明
r Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号
1 identification 2 first It’s usually a message serial number
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

单元标识 范围从 0x02~0xFE;用于连接 RS485 口的从机地址


Unit Range from 0x02 to 0xfe; slave address for connecting RS485
4 identification 1 ports
功能码 0x10 MODBUS 通讯协议的相关功能码
5 Function code 1 0x10 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
寄存器个数 高字节在前
Number of High Byte
7 registers 2 first

39
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
Dongguan AMX Automation Technology ETH-MODBUS-IO16R module product
Co. , Ltd. manual

数据个数 假设寄存器个数为 N,则数据个数的值为 2N,单位:字节


Number of Assuming that the number of registers is N, the number of data
8 data 1 values is 2n, in bytes
低字在前
The
lowercase 假设寄存器个数为 N,则数据的长度(字节)值为 2N
数据 2N word Assuming the number of registers is n, the length (bytes) value of
9 Data 2n comes first the data is 2n

写多个保持寄存器应答报文格式说明



写多个保持寄存器应答(MODBUS TCP 报文格式)


Write multiple hold register responses (Modbus TCP message format)
长度 字节
序号 LengthByte
Serial 报文字段 存放方式
numb Message (字节) Storage 说明
er Field (bytes) mode Account for
事务处理标识 高字节在前
Transaction High Byte 一般是报文序号,同请求报文
1 identification 2 first Usually a message serial number, the same as the request message
协议标识 高字节在前
Protocol High Byte 一般默认为 00 00
2 identification 2 first The default is 0000
除去事务处理标识、协议标识、以及报文长度的数据字节长
报文长度 高字节在前 度
Message High Byte The data byte length of transaction identification, protocol
3 length 2 first identification, and message length is removed

单元标识 范围从 0x02~0xFE;用于连接 RS485 口的从机地址


Unit Range from 0x02 to 0xfe; slave address for connecting RS485
4 identification 1 ports
功能码 0x10 MODBUS 通讯协议的相关功能码
5 Function code 1 0x10 The related function code of Modbus communication protocol
起始地址 高字节在前
Starting High Byte
6 address 2 first
寄存器个数 高字节在前
Number of High Byte
7 registers 2 first

 示例报文说明
Example message description

设置 127 号从站的保持寄存器 40001~40004 通道数值分别为 0x9C41、0x9C42、0x9C43、


0x9C44。
Set the hold register values for channels 40001 ~ 40004 for slave station 127 to
0x9C41,0X9C42,0X9C43, and 0x9C44, respectively.
请求报文:
Request message:
00 00 00 00 00 0B 7F 10 00 00 00 04 08 9C 41 9C 42 9C 43 9C 44
0000000000000000B 7F million 004089C 419c 429C 439c 44
应答报文
Reply message
00 00 00 00 00 06 7F 10 00 00 00 04
0000000000067F million 004

40
www.amsamotion.com
Www.amsamotion.com
东莞市艾莫迅自动化科技有限公司 ETH-MODBUS-IO16R 模块产品手册
ETH-MODBUS-IO16R module product manual, Dongguan, China

修订历史
Revision history
版本 修订日期 修订说明 维护人
Version Revision date Revision notes Vindicator
2020.09.04 初始版本 LIN
1.0 September 4,2020 Initial version Lin

关于我们
About Us
官方网站:http://amsamotion.com 邮箱:
Official website: amx@amsamotion.com
http://amsamotion.com Email: amx@amsamotion.
Com
销售热线:4001-522-518 拨
技术热线:4001-522-518 拨 1 2
Technical Hotline: 4001-522-518 Sales Hotline: 4001-522-518
Dial 1 Dial 2
公司地址:广东省东莞市南城区袁屋边艺展路 9 号兆炫制造园 B 栋 1 楼
Company address: 1/F, Building B, Zhaoxuan Manufacturing Park, 9 Yizhan Road,
Yuan Wu Bian, Dongguan City, Guangdong province

You might also like