Danfoss Modbus Protocol Programming guide

Page 1
Technical Paper
Danfoss Modbus Protocol
01/05 命令:读/写 Function Code 01/05 : Write/Read
名称
NO
Name
继电器输出
1
Relay Output Status
Data Type
Int
Modbus Address
1(0)
01/05
02 命令:只读 Function Code 02 : Read Only
名称
NO
Name
1
Device Failure
Data Type
Int
Modbus Address
1(0)
02
D00:继电器输出状态 0 关、1 开 (注:当 D01 为 0 自动时,D00 不可写;当 D01 为 1 手动强 制输出时,D00 可写。) D01:继电器输出优先控制使能 0 自动(温控器逻 辑控制) 、1 手动强制输出 D02- D07:保留
D00:Relay Output Status 0 Closed、1 Open (When D01 is 0, D00 is not be written; When D01 is 1, D00 can be written) D01: Relay output priority enable 0 Automatic, 1 Manual enable D02-D07: Retain
D00:内置探头故障 D01:外置探头故障 D02:EE 故障 D03:低于 0℃报警 D04:高于 50℃报警 D05- D07:保留
D00:Internal sensor failure D01:External sensor failure D02:EE Failure D03:Temp. below 0℃ alarm D04:Temp. high 50℃ alarm D05- D07:Retain
0 正常、1 故障 0 正常、1 故障 0 正常、1 故障 0 正常、1 故障 0 正常、1 故障
0 Normal、1 Fail 0 Normal、1 Fail 0 Normal、1 Fail 0 Normal、1 Fail 0 Normal、1 Fail
VFCUA12P
© Danfoss | FHH | 2016.05 | 1
Page 2
Technical Paper Danfoss Modbus Protocol
03/06 命令:读/写 Function Code 03/06: Read/Write
名称
NO
Name
温控器状态
1
Thermostat status
2
Desired room temperature
地面传感器 温度设定点
3
Desired floor temperature
键盘锁定使能
4
Child Lock ON/OFF 离开模式下
室内温度设定点
5
Desired room temp. for Away Mode
离开模式使能
6
Away Mode Enable
温度控制模式
7
Temperature Control Mode
最大房间温度限制
8
Maximum Room Temp. Limitation
最小房间温度限制
9
Minimum Room Temp. Limitation
地面温度限制模式
10
Floor Temp. Limitation Mode
地面温度限制设定值
11
Floor Temp. Limitation Setpoint
最大地面温度限制
12
Maximum Floor Temp. Limitation
最小地面温度限制
13
Minimum Floor Temp. Limitation
防冻保护使能
14
Frost Protection Enable
精度
Precision
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
Data Type
Modbus Address
1(0)
03/06
2(1)
03/06
3(2)
03/06
4(3)
03/06
5(4)
03/06
6(5)
03/06
7(6)
03/06
8(7)
03/06
9(8)
03/06
10(9)
03/06
11(10)
03/06
12(11)
03/06
13(12)
03/06
14(13)
03/06
00:关, 01:开, 02:防冻启动(只读) 00: Off, 01:On , 02: Frost protection(Read only)
温度值(5~30℃) (温度控制模式为 01 和 02 下有效,任何温控模 式下可读写) Temperature range(5~30℃) (Active in Temperature Control Mode 01 and 02, data can be read and written)
温度值(20~45℃) (温度控制模式为 03 下有效) Temperature range(20~45℃) (Active in Temperature Control Mode 03)
00:关;01:开; 00: Off, 01: On
温度值(5~30℃) Temperature range(5~30℃)
00:禁能;01:使能; 00: Disable, 01: Enable
01:单房间温度控制;02:双温双控;03:单地 板温度控制 01:Room temperature. control;02:Both room and floor temperature control; 03 : Floor temperature control
温度值(5~35℃) (温度控制模式为 01 和 02 下有效,任何温控模 式下可读写) Temperature range (5-35 ℃ ) (Active in Temperature Control Mode 01 and 02, data can be read and written)
温度值(5~35℃) (温度控制模式为 01 和 02 下有效,任何温控模 式下可读写) Temperature range (5-35 ℃ ) ( Active in Temperature Control Mode 01 and 02, data can be read and written)
01:高温限制;02:低温限制 (温度控制模式 02 下有效,任何温控模式下可读写) 01 : Maximum Temperature Limitation; 02: Mini­mum Temperature Limitation (Active in Temperature Control Mode 02, data can be read and written)
温度值(20~45℃) (温度控制模式 02 下有效,任何温控模式下可 读写) Temperature range (20-45 ℃) (Active in Temperature Control Mode 02, data can be read and written)
温度值(20~45℃) (温度控制模式 03 下有效,任何温控模式下可 读写) Temperature range (20-45 ℃ ) (Active in Temperature Control Mode 03, data can be read and written)
温度值(20~45℃) (温度控制模式 03 下有效,任何温控模式下可 读写) Temperature range (20-45 ℃) (Active in Temperature Control Mode 03, data can be read and written)
01:开启;02:关闭; 01: Enable, 02: Disable
2 | © Danfoss | FHH | 2016.05
VFCUA12P
Page 3
Technical Paper Danfoss Modbus Protocol
防冻保护温度设定点
15
Frost Protection Temp. Setpoint
关机后温度显示选项
16
POWER OFF Temp. Display Option
远程锁按键功能
17
Remote Button Lock
18
Room Temperature
地面传感器温度
19
Floor Temperature
1 Int
1 Int
1 Int
1 Int
1 Int
15(14)
03/06
16(15)
03/06
17(16)
03/06
18(17)
03
19(18)
03
温度值(5~17℃) Temperature range (5-17℃)
01:不显示当前温度;02:显示当前温度 01: No temperature display; 02: Current tempera­ture display
00:关;01:开; (本功能只有远程可以操作,如:使用本功能锁 定按键在本地是不可以解锁的只有远程可解锁) 00: Off, 01: On (This function only can be operated remotely)
温度值 (温度控制模式为 03 时上传数值为 0xff00) Temperature value (Temperature Control Mode 03, the value is 0xff00)
温度值 (温度控制模式为 01 时上传数值为 0xff00) Temperature value (Temperature Control Mode 01, the value is 0xff00 )
41 命令:只读,读取所有数据 Function Code 41: Read only, Read all datas
名称
NO
Name
继电器输出
1
Relay Output Status
2
Device Failure
温控器状态
3
Thermostat status
室温设定
4
Desired room temperature
精度
Precision
1 Int
1 Int
Data Type
BOOL 1(0)
BOOL 2(1)
Modbus Address
3(2)
03/06
4(3)
03/06
D00:继电器输出状态 0 关、1 开 (注:当 D01 为 0 自动时,D00 不可写;当 D01 为 1 手动强制输出时,D00 可写。) D01:继电器输出优先 控制使能 0 自动(温控器逻 辑控制)、1 手动强制输出 D02- D07:保留
D00:Relay Output Status 0 Closed、1 Open (When D01 is 0, D00 is not be written; When D01 is 1, D00 can be written) D01: Relay output priority enable 0 Automatic, 1 Manual enable D02-D07: Retain
D00:内置探头故障 0 正常、1 故障 D01:外置探头故障 0 正常、1 故障 D02:EE 故障 0 正常、1 故障 D03:低于 0℃报警 0 正常、1 故障 D04:高于 50℃报警 0 正常、1 故障 D05- D07:保留
D00:Internal sensor failure 0 Normal、1 Fail D01:External sensor failure 0 Normal、1 Fail D02:EE Failure 0 Normal、1 Fail D03:Temp. below 0℃ alarm 0 Normal、1 Fail D04:Temp. high 50℃ alarm 0 Normal、1 Fail D05- D07:Retain
00:关, 01:开, 02:防冻启动(只读) 00: Off, 01:On , 02: Frost protection(Read only)
温度值(5~30℃) (温度控制模式为 01 和 02 下有效,任何温控模式 下可 读写) Temperature range(5~30℃) (Active in Temperature Control Mode 01 and 02, data can be read and written)
VFCUA12P
© Danfoss | FHH | 2016.05 | 3
Page 4
Technical Paper Danfoss Modbus Protocol
地面传感器 温度设定点
5
Desired floor temperature
键盘锁定使能
6
Child Lock ON/OFF 离开模式下 室内温度
设定点
7
Desired room temp. for Away Mode
离开模式使能
8
Away Mode Enable
温度控制模式
9
Temperature Control Mode
最大房间温度限
10
制 Maximum Room Temp. Limitation
最小房间温度限制
11
Minimum Room Temp. Limitation
地面温度限制模式
12
Floor Temp. Limita­tion Mode
地面温度限制设定 值
13
Floor Temp. Limitation Setpoint
最大地面温度限制
14
Maximum Floor Temp. Limitation
最小地面温度限制
15
Minimum Floor Temp. Limitation
防冻保护使能
16
Frost Protection Enable
防冻保护温度设定 点
17
Frost Protection Temp. Setpoint
关机后温度显示选 项
18
POWER OFF Temp. Display Option
远程锁按键功能
19
Remote Button Lock
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
1 Int
5(4)
03/06
6(5)
03/06
7(6)
03/06
8(7)
03/06
9(8)
03/06
10(9)
03/06
11(10)
03/06
12(11)
03/06
13(12)
03/06
14(13)
03/06
15(14)
03/06
16(15)
03/06
17(16)
03/06
18(17)
03/06
19(18)
03/06
温度值(20~45℃) (温度控制模式为 03 下有效) Temperature range(20~45℃)(Active in Temperature Control Mode 03)
00:关;01:开; 00: Off, 01: On
温度值(5~30℃) Temperature range(5~30℃)
00:禁能;01:使能; 00: Disable, 01: Enable
01:单房间温度控制;02:双温双控;03:单地板 温度 控制 01:Room temperature. control;02:Both room and floor temperature control;03:Floor temperature con­trol
温度值(5~35℃) (温度控制模式为 01 和 02 下有效,任何温控模式 下可 读写) Temperature range (5-35 ℃) (Active in Temperature Control Mode 01 and 02, data can be read and written)
温度值(5~35℃) (温度控制模式为 01 和 02 下有效,任何温控模式 下可 读写) Temperature range (5-35℃)(Active in Temperature Control Mode 01 and 02, data can be read and written)
01:高温限制;02:低温限制 (温度控制模式 02 下有效,任何温控模式下可读 写) 01 : Maximum Temperature Limitation;02 : Mini­mum Temperature Limitation (Active in Temperature Control Mode 02, data can be read and written
温度值(20~45℃) (温度控制模式 02 下有效,任何温控模式下可读 写) Temperature range (20-45 ℃ ) (Active in Temperature Control Mode 02, data can be read and written)
温度值(20~45℃) (温度控制模式 03 下有效,任何温控模式下可读 写) Temperature range (20-45 ℃ ) (Active in Temperature Control Mode 03, data can be read and written)
温度值(20~45℃) (温度控制模式 03 下有效,任何温控模式下可读 写) Temperature range (20-45 ℃ ) (Active in Temperature Control Mode 03, data can be read and written)
01:开启;02:关闭; 01: Enable, 02: Disable
温度值(5~17℃) Temperature range (5-17℃)
01:不显示当前温度;02:显示当前温度 01:No temperature display; 02: Current tempera­ture display
00:关;01:开; (本功能只有远程可以操作,如:使用本功能锁定 按键 在本地是不可以解锁的只有远程可解锁) 00: Off, 01: On (This function only can be operated remotely)
4 | © Danfoss | FHH | 2016.05
VFCUA12P
Page 5
Technical Paper Danfoss Modbus Protocol
20
Room Temperature
地面传感器温度
21
Floor Temperature
1 Int
1 Int
20(19)
21(20)
Modbus 数据协议解释
Modbus Protocol Example
命令字节格式:Message Frame
字节格式 11 位格式:1 起始位+8 数据位+1 位奇校验+1 停止位
03
03
温度值 (温度控制模式为 03 时上传数值为 0xff00 Temperature value (Temperature Control Mode 03, the value is 0xff00 )
温度值 (温度控制模式为 01 时上传数值为 0xff00 Temperature value (Temperature Control Mode 01, the value is 0xff00 )
Format 11 Bits: 1 start bits + 8 data bits + 1 bit for even / odd parity + 1 Stop bit
命令解析(16 进制)Example (Hex) 一、读数据命令格式: Read Coils
发送:Request [设备地址] [命令号] [起始寄存器地址高 8 位] [低 8 位] [读取的寄存器数高 8 位] [低 8 位] [CRC 校验的低 8 位] [CRC 校验的高 8 位] [Slave Address] [Function] [Starting Address Hi] [Starting Address Lo] [Quantity of Coils Hi] [Quantity of Coils Lo] [Error Check Lo] [Error Check Hi] 接收:Respond [设备地址] [命令号] [返回的字节个数][数据 1][数据 2]……[数据 n][CRC 校验的低 8 位] [CRC 校验的高 8 位] [Slave Address] [Function] [Byte Count] [Data1] [Data2]……. [Data n] [Error Check Lo] [Error Check Hi]
例:设备地址为 01,利用 03 命令读取从地址 0(温控器状态)开始到地址 18(地面传感器温度)的所有数据。 地址 0 到 18 一共 有 19(Hex:13)个数据,即从温控器状态到地面传感器温度。 发送命令为:01 03 00 00 00 13 04 07 收到数据为:01 03 26 00 01 01 2C 01 0E 00 00 00 3C 00 00 00 01 01 2C 00 32 00 01 01 5E 01 5E 00 C8 00 01 00 32 00 01 00 00 00 E6 FF 00 44 23 注:接收到的数据中 26H(Dec:38)代表接收到 38 个字节数据,即返回 19 个数据,每个数据(int 型)占两个字 节。 For Example: Slave address 01, Function code 03, read all data from address 0 (Thermostat status) to address 18 (Floor temper­ature). There are 19 (Hex: 13) data from address 0 to 18. Request: 01 03 00 00 00 13 04 07 Respond: 01 03 26 00 01 01 2C 01 0E 00 00 00 3C 00 00 00 01 01 2C 00 32 00 01 01 5E 01 5E 00 C8 00 01 00 32 00 01 00 00 00 E6 FF 00 44 23 Comment: The 26H (Dec: 38) represent receiving 38 bytes, i.e. 19 data. One data (int type) contains 2 bytes.
例:设备地址为 01,利用 02 命令读取设备故障信息。 发送命令为:01 02 00 00 00 05 B8 09 收到数据为:01 02 01 00 A1 88 Example: Slave address 01, Function code 02, read Device Failure. Request: 01 02 00 00 00 05 B8 09 Respond: 01 02 01 00 A1 88
VFCUA12P
© Danfoss | FHH | 2016.05 | 5
Page 6
二、写单个数据命令格式:Write Single Coil
发送:Request [设备地址] [命令号] [需下置的寄存器地址高 8 位] [低 8 位] [下置的数据高 8 位] [低 8 位] [CRC 校验的低 8 位] [CRC 校验的高 8 位] [Slave Address] [Function] [Coil Address Hi] [Coil Address Lo] [Write Data Hi] [Write Data Lo] [Error Check Lo] [Error Check Hi] 接收:Respond 同发送命令(证明设置成功) Same as request
例:设备地址为 01,利用 06 命令修改地址 1(温度设定)的值,使温度设定为 300C。 30 摄氏度换算成所需数据为 01 2C (说明:2CH=44(Dec), (01*256+44)/10=30) 发送命令为:01 06 00 01 01 2C D8 47 接收数据为:01 06 00 01 01 2C D8 47 注:温度输出*10 上位机解析/10 Example: Slave address 01, Function code 06, Write value of address 1 (Desired room temperature) as 300C 30 changed to data 01 2C (2CH=44(Dec), (01*256+44)/10=30) Request:01 06 00 01 01 2C D8 47 Respond:01 06 00 01 01 2C D8 47 Comment: Temperature *10, Host /10
例:设备地址为 01,利用 05 命令设置继电器强制输出为闭合或打开。
首先设置手动强制输出:
然后设置继电器输出为闭合:
或者设置继电器输出为打开:
发送:01 05 00 01 FF 00 DD FA (FF 00 设置此位为 1;00 00 设置此位为 0) 接收:同上
发送:01 05 00 00 FF 00 8C 3A 接收:同上
发送:01 05 00 00 00 00 CD CA 接收:同上
Example: Slave address 01, Function code 05, Write Relay Output Status as Manual enable, Closed or Open
Write Relay output priority enable as manual enable
Request: 01 05 00 01 FF 00 DD FA Respond: Same as request
Write Relay Output Status is Closed
Request: 01 05 00 00 FF 00 8C 3A Respond: Same as request
Write Relay Output Status is Open
Request: 01 05 00 00 00 00 CD CA Respond: Same as request
Danfoss A/S
FHH • Ulvehavevej 61 • DK-7100 Vejle Denmark Phone: +45 7488 8500 Fax: +45 7488 8501 heating@danfoss.com • www.heating.danfoss.com
Danfoss can accept no responsibility for possible errors in catalogues, brochures and other printed material. Danfoss reserves the right to alter its products without notice. This also applies to products already on order provided that such alterations can be made without subsequential changes being necessary in specifications already agreed. All trademarks in this material are property of the respective companies. Danfoss and the Danfoss logotype are trademarks of Danfoss A/S. All rights reserved.
6 | © Danfoss | FHH | 2016.05
丹佛斯自动控制管理(上海)有限公司 地址:上海市宜山路900号科技大楼C楼22层 邮 编 :2 0 0 2 3 3 电话:+86 21 61513000 传真:+86 21 61513100
http://cn.heating.danfoss.com
VFCUA12P
Loading...