哈尔滨九洲MCModbus07367_第1页
哈尔滨九洲MCModbus07367_第2页
哈尔滨九洲MCModbus07367_第3页
哈尔滨九洲MCModbus07367_第4页
哈尔滨九洲MCModbus07367_第5页
已阅读5页,还剩20页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、HJZ-MC-型监控装置HJZ-MC-IV Monitor Equipment通讯规约(MC-Modbus-07367)Communication Conventions(MC-Modbus-07367)哈尔滨九洲电气股份有限公司HARBIN JIUZHOU ELECTRIC CO., LTD.用户通讯规约Communication Conventions For Consumer一, Modbus规约说明1. Modbus Instruction在Modbus规约通讯过程中每个字节的格式为:1个开始位,8个数据位,2个停止位。In the communication course abidi

2、ng by the Modbus Conventions, each bytes format is: 1 start-bit, 8 data-bits and 2 stop-bits.数据的桢结构的格式为:地址域(8位),功能域(8位),数据域(n×8位),CRC校验(16位)。The frame format of data: address field (8-bit), function field (8-bit), data field (n×8-bit), CRC parity (16-bit).对于九洲公司的监控装置来说:地址域(即监控的地址)是可以通过监控装置

3、设定的。功能域只识别功能编码03表示读一组寄存器;对于收到其他功能编码时,本监控发出例外情况响应。数据域包括多组数据,传送时,高位字节在前,低位字节在后。主机召唤从机的数据域包括从机寄存器的地址和数量,寄存器的地址是以0为参考的(例如查询地址为1的寄存器数值时,寄存器的地址为0);从机响应主机的数据域包括返回数据的字节计数和主机所要的数据。当本监控收到的数据地址是不允许时(即从机的寄存器地址是不允许的),将发出例外情况响应;当收到数据域的数值是不允许时(例如从机的寄存器的数量是不允许的),将发出例外情况响应。CRC域包括一个16位的二进制数,占两个字节,在传送时,低位字节在前,高位字节在后。C

4、RC校验码具体生成方式后面已给出C语言程序。In the monitor equipments produced by Jiuzhou Co., address field (for monitor) can be set through itself. Its function field can only identify function code 03 which stands for reading a group of registers; when it receives other function-codes, the monitor equipment executes e

5、xception response. Data field contains groups of data, and low-bit byte goes after high-bit byte. The data field of main machine calling sub-machine contains address information and the number of sub-machines registers; the reference point of address is 0 (Namely, the registers reference address wou

6、ld be 0 if its actual address is 1.); the data field of sub-machines response to main machine contains a byte count of returned data and the data demanded by main machine. When the monitor receives unavailable address (namely, the address of sub-machines register is unavailable.), the monitor equipm

7、ent executes exception response; when it receives unavailable value of data field (namely, the number of sub-machines registers is unavailable.), the monitor equipment executes exception response. CRC field contains a binary unit, 16-bit and which is occupying 2 bytes. Low-bit byte goes before high-

8、bit byte. The detailed generation of CRC parity code is given in the following C language program.1. 读保持寄存器(功能码 03H)1. Read Hold Register (Function Code 03H)下图是主机查询和从机响应的一个例子。主机要查询6号从机的寄存器,寄存器地址为12至14,寄存器地址为12的内容为260(十六进制104),寄存器地址为13的内容为270(十六进制10E),寄存器地址为14的内容为15(十六进制0F)。请注意,信息中规定起始寄存器的地址为11(十六进制为

9、B)。从机以功能编码响应,表明是一种正常的响应。字节计数表示将返回多少个8位数据项。作为遥测和遥信使用.The following table is an example that main machine queries and sub-machine responds. Main machine inquires about registers of sub-machine 6#, and the registers addresses are 1214: 12- 260 (104 in hexadecimal); 13- 270 (10E in hexadecimal); 14- 15

10、(0F in hexadecimal). The beginning registers reference address is 11 (B in hexadecimal) complying with our address rule. The normal response of sub-machine is to respond with function code. The count of bytes means how many 8-bit data items will be returned. And it is used to remotely detect and com

11、municate.从机地址(第1个字节)06功能编码(第2个字节)03开始地址高位(第3个字节)00开始地址地位(第4个字节)0B寄存器个数高位(第5个字节)00寄存器个数低位(第6个字节)03校验码(第7、8个字节)CRC低位CRC高位主机查询(十六进制)Sub-machines Address(First Byte)06Function Code(Second Byte)03Beginning Address, High-bit(Third Byte)00Beginning Address, Low-bit(Fourth Byte)0BRegisters unit, High-bit(Fi

12、fth Byte)00Registers unit, Low-bit(Fifth Byte)03Parity Code(Seventh And Eighth Byte)CRC Low-bitCRC High-bitMain machine query (hexadecimal)从机地址(第1个字节)06功能编码(第2个字节)03字节计数(第3个字节)06数据高位(第4个字节)01数据低位(第5个字节)04数据高位(第6个字节)01数据低位(第7个字节)0E数据高位(第8个字节)00数据低位(第9个字节)0F校验码(第10、11个字节)CRC低位CRC高位从机响应(十六进制)Sub-machin

13、es Address(First Byte)06Function Code(Second Byte)03Count Of bytes(Third Byte)06Datas High-bit(Fourth Byte)01Datas Low-bit(Fifth Byte)04Datas High-bit(Sixth Byte)01Datas Low-bit(Seventh Byte)0EDatas High-bit(Eighth Byte)00Datas Low-bit(Ninth Byte)0FParity Code(Tenth And Eleventh Byte)CRC Low-bitCRC

14、High-bitSub-machine responding (hexadecimal)2预置单个寄存器(功能码 06H(十六进制)2. Initialize Single Register (Function Code 06H (hexadecimal)预置单个寄存器为某个值,查询确定预置那个寄存器,预置值在查询数据域中。作为遥控使用.Initialize a single register with a certain value, and then inquire it to make sure the initialization of this register. Initial v

15、alue is in the query data field to be used in remote control.例子:主机把数据07D0(十六进制),保存到地置为002C(十六进制)的从机寄存器中。Example: Main machine saves data 07D0 (hexadecimal) to sub-machines register whose address is 002C (hexadecimal).从机地址(第1个字节)06功能编码(第2个字节)06寄存器地置高位(第3个字节)00寄存器地置低位(第4个字节)2C预置数据高位(第5个字节)07预置数据低位(第6个

16、字节)D0校验码 (第7个字节) (第8个字节)CRC低位CRC高位主机查询(十六进制)Sub-machines Address (First Byte)06Function Code (Second Byte)06Registers Address, High-bit (Third Byte)00Registers Address, Low-bit (Fourth Byte)2CInitial Data, High-bit (Fifth Byte)07Initial Data, Low-bit (Sixth Byte)D0Parity Code (Seventh Byte)(Eighth B

17、yte)CRC Low-bitCRC High-bitMain machine query (hexadecimal)从机地址(第1个字节)06功能编码(第2个字节)06寄存器个数高位(第3个字节)00寄存器个数低位(第4个字节)2C预置数据高位(第5个字节)07预置数据低位(第6个字节)D0校验码 (第7个字节) (第8个字节)CRC低位CRC高位从机响应(十六进制)与主机查询信息相同.Sub-machines Address (First Byte)06Function Code (Second Byte)06Registers unit, High-bit (Third Byte)00R

18、egisters unit, Low-bit (Fourth Byte)2CInitial Data, High-bit (Fifth Byte)07Initial Data, Low-bit (Sixth Byte)D0Parity Code (Seventh Byte)(Eighth Byte)CRC Low-bitCRC High-bitInformation of sub-machines response (hexadecimal) is the same as that of main machine query3. 预置多个寄存器(功能码 10H(十六进制)3. Initiali

19、ze Multiple Registers (Function Code 10H (hexadecimal)主机通过这个功能码,把多个数据保存到从机寄存器中作为遥调使用。 Main machine saves data 07D0 to sub-machines register for the purpose of remote debugging例如:主机把0064、0010保存到地址为002C、002D的寄存器中。从机地置为06H.Example: Main machine saves 0064, 0010 to registers whose addresses are 002C and

20、 002D respectively. Sub-machines address is 06H.从机地址(第1个字节)06功能编码(第2个字节)10起始地址高位(第3个字节)00起始地址低位(第4个字节)2C预置寄存器个数高位(第5个字节)00预置寄存器个数低位(第6个字节)02预置字节计数(第7个字节)04数据1高位(第8个字节)00数据1低位(第9个字节)64数据2高位(第10个字节)00数据2低位(第11个字节)10校验码(第12个字节) (第13个字节)CRC低位CRC高位主机查询(十六进制)Sub-machines Address (First Byte)06Function Cod

21、e (Second Byte)10Beginning Address, High-bit (Third Byte)00Beginning Address, Low-bit (Fourth Byte)2CInitial Registers unit, High-bit (Fifth Byte)00Initial Registers unit Low-bit (Sixth Byte)02Count Of Initial Bytes (Seventh Byte)04Data 1, High-bit (Eighth Byte)00Data 1, Low-bit (Ninth Byte)64Data 2

22、, High-bit (Tenth Byte)00Data 2, Low-bit (Eleventh Byte)10Parity Code (Twelfth Byte)(Thirteenth Byte)CRC Low-bitCRC High-bitMain machine query (hexadecimal)从机地址(第1个字节)06功能编码(第2个字节)10起始地址高位(第3个字节)00起始地址低位(第4个字节)2C预置寄存器个数高位(第5个字节)00预置寄存器个数低位(第6个字节)02校验码 (第7个字节) (第8个字节)CRC低位CRC高位从机响应(十六进制)Sub-machines

23、Address (First Byte)06Function Code (Second Byte)10Beginning Address, High-bit (Third Byte)00Beginning Address, Low-bit (Fourth Byte)2CInitial Registers unit, High-bit (Fifth Byte)00Initial Registers unit, Low-bit (Sixth Byte)02Parity Code (Seventh Byte)(Eighth Byte)CRC Low-bitCRC High-bitSub-machin

24、e responding (hexadecimal)4例外情况响应QUERY字节 内容 例子1 从机地址 062 功能编码 033 开始地址高位 004 开始地址低位 0B5 寄存器个数高位 006 寄存器个数低位 037、8 CRC校验 低字节、高字节EXCEPTION RESPONSE1 从机地址 062 功能编码 833 例外情况代码 024、5 CRC校验 低字节、高字节主机查询和从机例外情况响应4. Exception ResponseQUERYByte Content Example1 Sub-machines Address 062 Function Code 033 Origi

25、nation Address High-bit 004 Origination Address Low-bit 0B5 Registers Number High-bit 006 Registers Number Low-bit 037、8 CRC Parity High-bit, Low-bitEXCEPTION RESPONSE1 Sub-machines Address 062 Function Code 833 Exception Code 024、5 CRC Parity High-bit, Low-bitMain machine query and sub-machine exce

26、ption response正常响应时,从机以原来查询的功能编码应答,在例外情况响应是,从机将功能编码的MSB设为1。In normal response, sub-machine responds with original query function code; in exception response, sub-machine sets MSB of function code to 1.代码意义01从机收到的功能编码是不允许的02查询中的数据地址对于从机来说是非法的03查询中的数据域的数值不是从机所允许的例外情况代码和意义CodeMeaning01The function code

27、 received by sub-machine is unallowed.02The data address in query is nonlicet for sub-machine.03The value of data area in query is unallowed by sub-machine.Codes and Meanings of exception cases4生产CRC校验码的C语言程序:C language procedure of forming CRC parity code:Static ndigned char auchCRCHi=0x00,0xc1,0x8

28、1,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81, 0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0, 0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01, 0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41, 0x00,0xc1

29、,0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81, 0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0, 0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01, 0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40, 0x00,

30、0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81, 0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0, 0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01, 0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41, 0

31、x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81, 0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x01,0xc0, 0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01, 0xc0,0x80,0x41,0x00,0xc1,0x81,0x40,0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x4

32、1, 0x00,0xc1,0x81,0x40,0x01,0xc0,0x80,0x41,0x01,0xc0,0x80,0x41,0x00,0xc1,0x81,0x40;static char auchCRCLo=0x00,0xc0,0xc1,0x01,0xc3,0x03,0x02,0xc2,0xc6,0x06,0x07,0xc7,0x05,0xc5,0xc4, 0x04,0xCC,0x0C,0x0D,0xCD,0x0F,0xCF,0xCE,0x0E,0x0A,0xCA,0xCB,0x0B,0xC9,0x09, 0x08,0xC8,0xD8,0x18,0x19,0xD9,0x1B,0xDB,0xD

33、A,0x1A,0x1E,0xDE,0xDF,0x1F,0xDD, 0x1D,0x1C,0xDC,0x14,0xD4,0xD5,0x15,0xD7,0x17,0x16,0xD6,0xD2,0x12,0x13,0xD3, 0x11,0xD1,0xD0,0x10,0xF0,0x30,0x31,0xF1,0x33,0xF3,0xF2,0x32,0x36,0xF6,0xF7, 0x37,0xF5,0x35,0x34,0xF4,0x3C,0xFC,0xFD,0x3D,0xFF,0x3F,0x3E,0xFE,0xFA,0x3A, 0x3B,0xFB,0x39,0xF9,0xF8,0x38,0x28,0xE8

34、,0xE9,0x29,0xEB,0x2B,0x2A,0xEA,0xEE, 0x2E,0x2F,0xEF,0x2D,0xED,0xEC,0x2C,0xE4,0x24,0x25,0xE5,0x27,0xE7,0xE6,0x26, 0x22,0xE2,0xE3,0x23,0xE1,0x21,0x20,0xE0,0xA0,0x60,0x61,0xA1,0x63,0xA3,0xA2, 0x62,0x66,0xA6,0xA7,0x67,0xA5,0x65,0x64,0xA4,0x6C,0xAC,0xAD,0x6D,0xAF,0x6F, 0x6E,0xAE,0xAA,0x6A,0x6B,0xAB,0x69,

35、0xA9,0xA8,0x68,0x78,0xB8,0xB9,0x79,0xBB, 0x7B,0x7A,0xBA,0xBE,0x7E,0x7F,0xBF,0x7D,0xBD,0xBC,0x7C,0xB4,0x74,0x75,0xB5, 0x77,0xB7,0xB6,0x76,0x72,0xB2,0xB3,0x73,0xB1,0x71,0x70,0xB0,0x50,0x90,0x91, 0x51,0x93,0x53,0x52,0x92,0x96,0x56,0x57,0x97,0x55,0x95,0x94,0x54,0x9C,0x5C, 0x5D,0x9D,0x5F,0x9F,0x9E,0x5E,0

36、x5A,0x9A,0x9B,0x5B,0x99,0x59,0x58,0x98,0x88, 0x48,0x49,0x89,0x4B,0x8B,0x8A,0x4A,0x4E,0x8E,0x8F,0x4F,0x8D,0x4D,0x4C,0x8C, 0x44,0x84,0x85,0x45,0x87,0x47,0x46,0x86,0x82,0x42,0x43,0x83,0x41,0x81,0x80,0x40;unsigned short CRC16(unsigned char *pushMsg,unsigned short usDataLen) unsigned char uchCRCHi=0xff;

37、unsigned char uchCRCLo=0xff; unsigned uIndex; while(usDataLen-) uIndex=uchCRCHi *pushMsg+; uchCRCHi=uchCRCLo auchCRCHiuIndex; uchCRCLo=auchCRCLouIndex; return(uchCRCHi << 8 | uchCRCLo); 监控装置寄存器地址如下:Registers Address Of Itinerant Inspection Meter: 名称-寄存器地址Name-Registers Address充电机电压-1Charge Vol

38、tage-1充电机电流-2Charge Current-2控母电压-3KM Voltage-3控母电流-4KM Current -4电池组电压-5Battery Group Voltage-5电池组电流1-6Battery Group Current-6模拟量备用-7 Analogue Res-7放电电流-8 Discharge IA -8相电压-9A-phase Voltage-9B相电压-10B-phase Voltage-10C相电压-11C-phase Voltage-11A相电流-12A-phase Current-12B相电流-13B-phase Current-13C相电流-14

39、C-phase Current-14说明:以上量传送的数据都是有符号数。 以上量传送的数据和实际显示数据的计算关系如下:实际显示数据=(上传数据高位字节*256+上传数据低位字节)/10Note: All data sent with up quantum are numbers with symbols. The transformation between data sent with up quantum and Actually displayed data are listed below: Actually displayed data = (High-bit byte of da

40、ta sent up×256 + Low-bit byte of data sent up) /10名称-寄存器地址Name-Registers Address第1只电池电压-31Voltage Of Battery 1# -31第2只电池电压-32Voltage Of Battery 2#-32第3只电池电压-33Voltage Of Battery 3#-33.第106只电池电压-136Voltage Of Battery106#-136第107只电池电压-137Voltage Of Battery 107#-137第108只电池电压-138Voltage Of Battery

41、108#-138说明:以上量传送的数据都是有符号数。以上量传送的数据和实际显示数据的计算关系如下:实际显示数据=(上传数据高位字节*256+上传数据低位字节)/100Note: All data sent with up quantum are numbers with symbols. The transformation between data sent with up quantum and actually displayed data are listed below: Actually displayed data = (High-bit byte of data sent up

42、×256 + Low-bit byte of data sent up) /100名称-寄存器地址Name-Registers Address1段正母对地电压-151+ML Grounded Voltage-1511段正母对地电阻-152+ML Grounded Resistance-1521段负母对地电压-153ML Grounded Voltage-1531段负母对地电阻-154ML Grounded Resistance-1542段正母对地电压-155 +ML Grounded Voltage-1552段正母对地电阻-156 +ML Grounded Resistance-15

43、62段负母对地电压-157 ML Grounded Voltage-1572段负母对地电阻-158 ML Grounded Resistance-158第1支路接地电阻-159Branch 1# Grounded Resistance-159第2支路接地电阻-160Branch 2# Grounded Resistance-160第3支路接地电阻-161Branch 3# Grounded Resistance-161.第94支路接地电阻-252Branch 94# Grounded Resistance-252第95支路接地电阻-253Branch 95 Grounded Resistanc

44、e-253第96支路接地电阻-254Branch 96# Grounded Resistance-254说明:以上量传送的数据都是有符号数。Note: All data sent with up quantum are numbers with symbols.当母线对地电阻是负数时,表示母线负端接地;当母线对地电阻是正数时,表示母线正端接地。If the resistance of main line to ground is negative, it indicates that the negative end of main line is grounded.当支路接地电阻是负数时,表

45、示支路负端接地;当支路接地电阻是正数时,表示支路正端接地。If the resistance of branch to ground is negative, it indicates that the negative end of branch is grounded.母线和支路正常时,即没有接地时,上传32767。If main line and branch work normally, namely both of them are not grounded, 32767 is sent up.以上量传送的数据和实际显示数据的计算关系如下:实际显示数据=(上传数据高位字节*256+上

46、传数据低位字节)/10 The transformation between data sent with up quantum and actually displayed data are listed below: actually displayed data = (High-bit byte of data sent up×256 + Low-bit byte of data sent up) /10名称-寄存器地址Name-Registers Address充电机故障-271Charger Failure-271电池熔断器断-272Battery Fuse Break-2

47、72馈线开关报警-273FL Switch Alarm-273避雷器报警-274Arrester Alarm-274合母超限-275HM OverLimit-275控母超限-276KM OverLimit-276充电机输出过流-277Output Charge Current OverLimit-277交流电压超限-278AC Voltage OverLimit-278母线接地-279ML Grounded-279母线对地电压超限-280ML Voltage OverLimit-280电池故障-281Battery Alarm-281备用1-282Spare 2-282备用2-283Spare 2-283备用3-284Spare 3-284备用4-285Spare 4-285未定义-286No Define-286主充(充电状态)-287Main Charge (Charge State)-287均充(充电状态)-288Equalizing Charge (Charge State)-288浮充(充电状态)-289Float Charge (Charge State)-289工作/停止-290Start/Stop-29032路开关量 32 switch开关量32路地址(351382)switch 32 Registers A

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论