您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 冶金工业 > PSM-E10C上位机协议V2-48V-MODBUS
通信电源监控PSM-E10C上位机通信协议第1页共6页郑州华伟电器技术有限公司1概述本文所叙述的通信协议适用于本公司所生产的电源监控系统PSM-E20C系列版本的产品。物理接口:PSM-E20C系列监控同时提供RS232和RS485通信接口,用户可任意选择其中之一与后台设备联机。注意,若选用RS485接口连接到电脑串行通信口,则需外加一个RS485-RS232转换头转接。通信波特率9600bps。每一帧由10位(1位起始位,8位数据位,1位停止位,无校验位)组成。在开始通信前,请先设定好监控系统的通信参数,如通信地址、通信速率和通信协议。通信地址从1到99可选。若用户选用ModBus规约,建议远程终端下发命令的时间间隔在5秒钟以上,波特率越低时间应适当延长。在今后的产品升级过程中,本通信协议若有修改,恕本公司不另行通知,请及时垂询本公司或访问本公司网站。字符延时小于50ms桢间延时200ms2ModBus协议2.1遥测遥测1下传:定义地址功能码STARADDR数据长度CRC校验数据ADDR03H6000HLENCRC16字节数11222ADDR:监控设备地址。STARTADDR为一特定值,不可随便更改。数据长度:指请求设备返回的遥测数据长度。发送时高位在前,低位在后,不可超过指定长度(0x20)。CRC校验:采用CRC16校验法,发送时低位在前,高位在后,计算方法请参阅下面章节。遥测返回:定义地址功能码长度返回数据CRC校验数据ADDR03H数据长度DATACRC16字节数112LEN*22数据长度字节数由原来1字节改为两字节Data就是信息长度,不是字节数通信电源监控PSM-E10C上位机通信协议第2页共6页郑州华伟电器技术有限公司遥测1(重要)返回DATA定义:寄存器地址定义传输方式放大系数单位6000交流A相电压UaH—L10V6001交流B相电压UbH—L10V6002交流C相电压UcH—L10V6003预留合闸母线电压(1段)H—L10V6004预留合闸母线电压(2段)H—L10V6005直流母线电压(1段)H—L10V6006预留控制母线电压(2段)H—L10V6007直流母线电流(1段)H—L10A6008预留控制母线电流(2段)H—L10A6009充电装置电压H—L10V600A预留充电装置电流H—L10A600B蓄电池组电压H—L10V600C蓄电池组电流H—L10A600D预留电池环境温度H—L10℃600E预留正母线对地绝缘电阻H—L10KΩ600F预留负母线对地绝缘电阻H—L10KΩ2.2遥信遥信下传:定义地址功能码STARADDR数据长度CRC校验数据ADDR02H7000HLENCRC16字节数11222数据长度指遥信量长度,1个字节包含8个遥信量。遥信返回:定义地址功能码数据长度返回数据CRC校验数据ADDR02H(LEN+7)/8DATACRC16字节数1122注:0为备用,1为工作;0为浮充,1为均充;0为正常,1为故障;0为开机,1为关机。遥信1(重要)寄存器地址字节Bits定义7000HBit7系统总故障Bit6电池充电方式(均充或浮充)Bit5交流供电回路(1路或2路)Bit4~Bit0未定义LBit7-Bit0未定义7001HBit7-Bit01~8号充电模块故障LBit7-Bit0预留9~16号充电模块故障7002HBit7交流电源故障通信电源监控PSM-E10C上位机通信协议第3页共6页郑州华伟电器技术有限公司Bit6未定义Bit5未定义Bit4未定义Bit3-Bit0未定义LBit7预留合闸母线过压Bit6预留合闸母线欠压Bit5控制母线过压Bit4控制母线欠压Bit3蓄电池组欠压Bit2预留电池充电过流Bit1预留单体电池过压Bit0预留单体电池欠压7003HBit7预留防雷器故障Bit6电池熔断器故障Bit5电池开关断开Bit4馈出支路开关跳闸Bit3预留母线绝缘故障Bit2-Bit0未定义LBit7-Bit0未定义2.3遥调遥调下传:定义地址功能码DATAREGVALUECRC校验数据ADDR06HDATACRC16字节数11222DATAREG定义:(高位在前,低位在后)DATAREG遥调内容单位系数设定范围7100H浮充电压,(高位在前,低位在后)V10100~3207200H均充电压,(高位在前,低位在后)V10110~320遥调返回:定义地址功能码DATAREGVALUECRC校验数据ADDR06HDATACRC16字节数112222.4遥控遥控下传:定义地址功能码遥控编号VALUECRC校验数据ADDR0FH78XXHDATACRC16字节数11222通信电源监控PSM-E10C上位机通信协议第4页共6页郑州华伟电器技术有限公司遥控编号遥控内容DATA7800H~780fH01~16号模块开关机控制0=开机,1=关机7810H均浮充控制0=浮充,1=均充举例:控制#2号模块关机:发送命令:010f78010001控制#2号模块开机:发送命令:010f78000000遥控返回:定义地址功能码遥控编号VALUECRC校验数据ADDR0FH78XXHDATACRC16字节数112222.5错误返回:定义地址功能码CODECRC校验数据ADDRCOM+80H1CRC16字节数11122.6CRC16校验码计算方法CRC添加到消息中时,低字节先加入,然后高字节。CRC简单函数如下:unsignedshortCRC16(puchMsg,usDataLen)unsignedchar*puchMsg;/*要进行CRC校验的消息*/unsignedshortusDataLen;/*消息中字节数*/{unsignedcharuchCRCHi=0xFF;/*高CRC字节初始化*/unsignedcharuchCRCLo=0xFF;/*低CRC字节初始化*/unsigneduIndex;/*CRC循环中的索引*/while(usDataLen--)/*传输消息缓冲区*/{uIndex=uchCRCHi^*puchMsgg++;/*计算CRC*/uchCRCHi=uchCRCLo^auchCRCHi[uIndex};uchCRCLo=auchCRCLo[uIndex];}return(uchCRCHi8|uchCRCLo);}/*CRC高位字节值表*/staticunsignedcharauchCRCHi[]={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,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x01,0xC0,0x80,0x41,0x00,0xC1,0x81,0x40,0x01,0xC0,0x80,0x41,0x00,0xC1,通信电源监控PSM-E10C上位机通信协议第5页共6页郑州华伟电器技术有限公司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,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,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,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,0x81,0x40};/*CRC低位字节值表*/staticcharauchCRCLo[]={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,0xDA,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,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,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,0x5
本文标题:PSM-E10C上位机协议V2-48V-MODBUS
链接地址:https://www.777doc.com/doc-2888207 .html