diff --git a/bin/Release/ESS.exe b/bin/Release/ESS.exe index 5290498..3f6d9b6 100644 Binary files a/bin/Release/ESS.exe and b/bin/Release/ESS.exe differ diff --git a/bin/Release/assets/config/EMU对外通信点表最终修改1版_v9.xlsx b/bin/Release/assets/config/EMU对外通信点表最终修改1版_v9.xlsx index 17dafac..c243f3e 100644 Binary files a/bin/Release/assets/config/EMU对外通信点表最终修改1版_v9.xlsx and b/bin/Release/assets/config/EMU对外通信点表最终修改1版_v9.xlsx differ diff --git a/bin/Release/assets/config/monitoraddr.json b/bin/Release/assets/config/monitoraddr.json new file mode 100644 index 0000000..06e9005 --- /dev/null +++ b/bin/Release/assets/config/monitoraddr.json @@ -0,0 +1,109 @@ +{ + "EMS":{ + "deviceType":101, + "addr_YC":[ + ["A相电压", "0x107E", "0.0", " V", "0.1"], + ["A相电流", "0x1084", "0.0", " A"], + ["B相电压", "0x1080", "0.0", " V", "0.1"], + ["B相电流", "0x1086", "0.0", " A"], + ["C相电压", "0x1082", "0.0", " V", "0.1"], + ["C相电流", "0x1088", "0.0", " A"] + ], + "addr_YX": [ ] + }, + "PCS":{ + "deviceType":102, + "addr_YC":[ + ["A相电压", "0x0010", "0.0", " V", "0.1"], + ["A相电流", "0x0019", "0.0", " A"], + ["B相电压", "0x0011", "0.0", " V", "0.1"], + ["B相电流", "0x001A", "0.0", " A"], + ["C相电压", "0x0011", "0.0", " V", "0.1"], + ["C相电流", "0x001B", "0.0", " A"] + ], + "addr_YX": [ ] + }, + "PCU":{ + "deviceType":103, + "addr_YC":[ + ["A相电压", "0x0013", "0.0", " V", "0.1"], + ["A相电流", "0x001C", "0.0", " A"], + ["B相电压", "0x0014", "0.0", " V", "0.1"], + ["B相电流", "0x001D", "0.0", " A"], + ["C相电压", "0x0015", "0.0", " V", "0.1"], + ["C相电流", "0x001E", "0.0", " A"] + ], + "addr_YX": [ ] + }, + "BMS":{ + "deviceType":104, + "addr_YC":[ + ["SOC", "0x0001", "0", " %"], + ["SOH", "0x0002", "0", " %"], + ["电压", "0x0003", "0.0", " V", "0.1"], + ["电流", "0x0005", "0.0", " A"], + ["单体最大电压", "0x0021", "0.0", " V", "0.1"], + ["单体最小电压", "0x0024", "0.0", " V", "0.1"], + ["单体最大温度", "0x0029", "0.0", " ℃"], + ["单体最小温度", "0x002C", "0.0", " ℃"] + ], + "addr_YX": [ ] + }, + "BCU":{ + "deviceType":105, + "addr_YC":[ + ["簇电压", "0x0003", "0.0", " V"], + ["簇电流", "0x0005", "0", " A"], + ["簇温度", "0x0007", "0.0", " ℃"], + ["簇电阻", "0x0009", "0.0", " Ω"], + ["簇SOC", "0x000B", "0", " %"], + ["簇SOH", "0x000C", "0", " %"] + ], + "addr_YX": [ ] + }, + "MEM":{ + "deviceType":3, + "addr_YC":[ + ["A相电压", "0x000B", "0.0", " V"], + ["A相电流", "0x000D", "0.0", " A"], + ["B相电压", "0x000F", "0.0", " V"], + ["B相电流", "0x0011", "0.0", " A"], + ["C相电压", "0x0013", "0.0", " V"], + ["C相电流", "0x0015", "0.0", " A"] + ], + "addr_YX": [ ] + }, + "TH": { + "deviceType":10, + "addr_YC":[ + ["温度", "0x0003", "0.0", " ℃", "0.1"], + ["湿度", "0x0004", "0.0", " %", "0.1"] + ], + "addr_YX": [ ] + }, + "Cooling": { + "deviceType":14, + "addr_YC":[ + ["开关", "0x1003", "0", "", "1"], + ["采样模式", "0x1004", "0", "", "1"], + ["制冷状态", "0x1005", "0", "", "1"], + ["制热状态", "0x1006", "0", "", "1"], + ["高温告警", "0x1007", "0", "", "1"], + ["低温告警", "0x1008", "0", "", "1"], + ["高压告警", "0x1009", "0", "", "1"], + ["低压告警", "0x100A", "0", "", "1"] + ] + }, + "Charger": { + "deviceType":106, + "addr_YC":[ + ["需求电压", "31071", "0.0", " V"], + ["需求电流", "31073", "0.0", " A"], + ["需求功率", "31075", "0.0", " kW"], + ["功率限值", "31077", "0.0", " kW"], + ["输出电压", "31079", "0.0", " V"], + ["输出电流", "31081", "0.0", " A"], + ["输出功率", "31083", "0.0", " kW"] + ] + } +} \ No newline at end of file diff --git a/bin/Release/assets/config/registeraddr.json b/bin/Release/assets/config/registeraddr.json index 3603a0f..49c89d5 100644 --- a/bin/Release/assets/config/registeraddr.json +++ b/bin/Release/assets/config/registeraddr.json @@ -1,893 +1,858 @@ { - "EMS_YT": { - "count":1, + "EMS_YT":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "EMS工作模式 RW u - 0:无效1:本地控制模式, EMS不接受平台调控2:平台控制模式, EMS接收平台调控指令"}, - {"key": "0x0002", "datatype": "int16", "remark": "有功功率 RW kW 并网恒功率模式下交流侧功率值:<0: 充电功率0: 静置>0: 放电功率"}, - {"key": "0x0003", "datatype": "int16", "remark": "PCS开关机 RW u - 0: 关机1: 开机 软件开关机"}, - {"key": "0x0004", "datatype": "int16", "remark": "主控对象 RW u 储能遥控对象:0:无效1:华云2:轻舟"}, - {"key": "0x0005", "datatype": "int16", "remark": "A相有功功率 RW 1kW"}, - {"key": "0x0006", "datatype": "int16", "remark": "B相有功功率 RW 1kW"}, - {"key": "0x0007", "datatype": "int16", "remark": "C相有功功率 RW 1kW"}, - {"key": "0x0008", "datatype": "int16", "remark": "三相总有功功率 RW 1kW"}, - {"key": "0x0009", "datatype": "int16", "remark": "A相无功功率 RW 1kVar"}, - {"key": "0x000A", "datatype": "int16", "remark": "B相无功功率 RW 1kVar"}, - {"key": "0x000B", "datatype": "int16", "remark": "C相无功功率 RW 1kVar"}, - {"key": "0x000C", "datatype": "int16", "remark": "三相总无功功率 RW 1kVar"}, - {"key": "0x000D", "datatype": "int16", "remark": "A相电流 RW 0.01A 在使用的时候除以100转float"}, - {"key": "0x000E", "datatype": "int16", "remark": "B相电流 RW 0.01A"}, - {"key": "0x000F", "datatype": "int16", "remark": "C相电流 RW 0.01A"}, - {"key": "0x0010", "datatype": "int16", "remark": "A相电压 RW u 1V"}, - {"key": "0x0011", "datatype": "int16", "remark": "B相电压 RW u 1V"}, - {"key": "0x0012", "datatype": "int16", "remark": "C相电压 RW u 1V"}, - {"key": "0x0013", "datatype": "int16", "remark": "A相交流功率因数 RW 0.01 在使用的时候除以100转float"}, - {"key": "0x0014", "datatype": "int16", "remark": "B相交流功率因数 RW 0.01"}, - {"key": "0x0015", "datatype": "int16", "remark": "C相交流功率因数 RW 0.01"}, - {"key": "0x0016", "datatype": "int16", "remark": "A相视在功率 RW 1kVA"}, - {"key": "0x0017", "datatype": "int16", "remark": "B相视在功率 RW 1kVA"}, - {"key": "0x0018", "datatype": "int16", "remark": "C相视在功率 RW 1kVA"}, - {"key": "0x0019", "datatype": "int16", "remark": "正向总有功总需量 RW 1kW"}, - {"key": "0x001A", "datatype": "int16", "remark": "数据有效性 RW 0无效 1有效"}, - {"key": "0x001B", "datatype": "int16", "remark": "EMS工作模式 RW u - 0:无效1:本地控制模式, EMS不接受平台调控2:平台控制模式, EMS接收平台调控指令 2413项目需求"}, - {"key": "0x001C", "datatype": "int16", "remark": "有功功率 RW u kW 并网恒功率模式下交流侧功率值:功率绝对值 没有正负 2413项目需求"}, - {"key": "0x001D", "datatype": "int16", "remark": "充放电类型 RW u - 0: 关机1: 充电2:放电3:待机 2413项目需求充放电类型"}, - {"key": "0x001E", "datatype": "int16", "remark": "最大SOC RW u 2413项目需求"}, - {"key": "0x001F", "datatype": "int16", "remark": "最小SOC RW u 2413项目需求"}, - {"key": "0x0020", "datatype": "int16", "remark": "自动并离网 RW u 0:手动1:自动 2332项目需求(若为自动,则通过主控进行并离网切换)"}, - {"key": "0x0021", "datatype": "int16", "remark": "并网离网 RW u 0:并网1:离网 2332项目需求(该下发参数的前提为手动模式下)"} + {"key": "0x0001", "datatype": "uint16", "remark": "EMS工作模式0:无效1:本地控制模式, EMS不接受平台调控2:平台控制模式, EMS接收平台调控指令(-)"}, + {"key": "0x0002", "datatype": "int16", "remark": "有功功率并网恒功率模式下交流侧功率值:<0: 充电功率0: 静置>0: 放电功率(kW)"}, + {"key": "0x0003", "datatype": "uint16", "remark": "PCS开关机0: 关机1: 开机(-)"}, + {"key": "0x0004", "datatype": "uint16", "remark": "主控对象储能遥控对象:0:无效1:华云2:轻舟"}, + {"key": "0x0005", "datatype": "int16", "remark": "A相有功功率(1kW)"}, + {"key": "0x0006", "datatype": "int16", "remark": "B相有功功率(1kW)"}, + {"key": "0x0007", "datatype": "int16", "remark": "C相有功功率(1kW)"}, + {"key": "0x0008", "datatype": "int16", "remark": "三相总有功功率(1kW)"}, + {"key": "0x0009", "datatype": "int16", "remark": "A相无功功率(1kVar)"}, + {"key": "0x000A", "datatype": "int16", "remark": "B相无功功率(1kVar)"}, + {"key": "0x000B", "datatype": "int16", "remark": "C相无功功率(1kVar)"}, + {"key": "0x000C", "datatype": "int16", "remark": "三相总无功功率(1kVar)"}, + {"key": "0x000D", "datatype": "int16", "remark": "A相电流(0.01A)"}, + {"key": "0x000E", "datatype": "int16", "remark": "B相电流(0.01A)"}, + {"key": "0x000F", "datatype": "int16", "remark": "C相电流(0.01A)"}, + {"key": "0x0010", "datatype": "uint16", "remark": "A相电压(1V)"}, + {"key": "0x0011", "datatype": "uint16", "remark": "B相电压(1V)"}, + {"key": "0x0012", "datatype": "uint16", "remark": "C相电压(1V)"}, + {"key": "0x0013", "datatype": "int16", "remark": "A相交流功率因数(0.01)"}, + {"key": "0x0014", "datatype": "int16", "remark": "B相交流功率因数(0.01)"}, + {"key": "0x0015", "datatype": "int16", "remark": "C相交流功率因数(0.01)"}, + {"key": "0x0016", "datatype": "int16", "remark": "A相视在功率(1kVA)"}, + {"key": "0x0017", "datatype": "int16", "remark": "B相视在功率(1kVA)"}, + {"key": "0x0018", "datatype": "int16", "remark": "C相视在功率(1kVA)"}, + {"key": "0x0019", "datatype": "int16", "remark": "正向总有功总需量(1kW)"}, + {"key": "0x001A", "datatype": "int16", "remark": "数据有效性0无效 1有效"}, + {"key": "0x001B", "datatype": "uint16", "remark": "EMS工作模式0:无效1:本地控制模式, EMS不接受平台调控2:平台控制模式, EMS接收平台调控指令(-)"}, + {"key": "0x001C", "datatype": "uint16", "remark": "有功功率并网恒功率模式下交流侧功率值:功率绝对值 没有正负(kW)"}, + {"key": "0x001D", "datatype": "uint16", "remark": "充放电类型0: 关机1: 充电2:放电3:待机(-)"}, + {"key": "0x001E", "datatype": "uint16", "remark": "最大SOC"}, + {"key": "0x001F", "datatype": "uint16", "remark": "最小SOC"}, + {"key": "0x0020", "datatype": "uint16", "remark": "自动并离网0:手动1:自动"}, + {"key": "0x0021", "datatype": "uint16", "remark": "并网离网0:并网1:离网"} ] }, - "BCU_YX": { - "count":1, + "EMS_YX":{ "addr":[ - {"key": "0xA001", "datatype": "int16", "remark": "所属通道号 R u 1~4"}, - {"key": "0xA002", "datatype": "int16", "remark": "所属BCU号 R u 1~40"}, - {"key": "0xA003", "datatype": "int16", "remark": "蓄电池充放电状态 R u 0x11开路0x22待机0x33充电0x44放电"}, - {"key": "0xA004", "datatype": "int16", "remark": "电池组运行状态 R u 0x11跳机0x22待机0x33放空0x44充满0x55预警0x66正常"}, - {"key": "0xA005", "datatype": "int16", "remark": "簇DO1状态 R u 1:断开 2:闭合"}, - {"key": "0xA006", "datatype": "int16", "remark": "簇DO2状态 R u 1:断开 2:闭合"}, - {"key": "0xA007", "datatype": "int16", "remark": "继电器总正 R u 0:断开 1:闭合 2:粘连"}, - {"key": "0xA008", "datatype": "int16", "remark": "继电器总负 R u 0:断开 1:闭合 2:粘连"}, - {"key": "0xA009", "datatype": "int16", "remark": "继电器预充 R u 0:断开 1:闭合 2:粘连"}, - {"key": "0xA00A", "datatype": "int16", "remark": "继电器bmu供电 R u 0:断开 1:闭合 2:粘连"}, - {"key": "0xA00B", "datatype": "int16", "remark": "整簇总电压过高告警 R u 0:正常 1:告警"}, - {"key": "0xA00C", "datatype": "int16", "remark": "整簇总电压过低告警 R u 0:正常 1:告警"}, - {"key": "0xA00D", "datatype": "int16", "remark": "整簇中单体电压过高告警 R u 0:正常 1:告警"}, - {"key": "0xA00E", "datatype": "int16", "remark": "整簇中单体电压过低告警 R u 0:正常 1:告警"}, - {"key": "0xA00F", "datatype": "int16", "remark": "整簇中单体电压偏差过大告警 R u 0:正常 1:告警"}, - {"key": "0xA010", "datatype": "int16", "remark": "整簇中单体温度偏差过大告警 R u 0:正常 1:告警"}, - {"key": "0xA011", "datatype": "int16", "remark": "整簇中单体温度过高告警 R u 0:正常 1:告警"}, - {"key": "0xA012", "datatype": "int16", "remark": "整簇中单体温度过低告警 R u 0:正常 1:告警"}, - {"key": "0xA013", "datatype": "int16", "remark": "整簇总充电电流过高告警 R u 0:正常 1:告警"}, - {"key": "0xA014", "datatype": "int16", "remark": "整簇总放电电流过高告警 R u 0:正常 1:告警"}, - {"key": "0xA015", "datatype": "int16", "remark": "整簇总SOC过高告警 R u 0:正常 1:告警"}, - {"key": "0xA016", "datatype": "int16", "remark": "整簇总SOC过低告警 R u 0:正常 1:告警"}, - {"key": "0xA017", "datatype": "int16", "remark": "高压盒主正接触器粘连告警 R u 0:正常 1:告警"}, - {"key": "0xA018", "datatype": "int16", "remark": "高压盒主正接触器不能吸合告警 R u 0:正常 1:告警"}, - {"key": "0xA019", "datatype": "int16", "remark": "高压盒主负接触器粘连告警 R u 0:正常 1:告警"}, - {"key": "0xA01A", "datatype": "int16", "remark": "高压盒主负接触器不能吸合告警 R u 0:正常 1:告警"}, - {"key": "0xA01B", "datatype": "int16", "remark": "高压盒预充接触器粘连告警 R u 0:正常 1:告警"}, - {"key": "0xA01C", "datatype": "int16", "remark": "高压盒预充接触器不能吸合告警 R u 0:正常 1:告警"}, - {"key": "0xA01D", "datatype": "int16", "remark": "预充失败告警 R u 0:正常 1:告警"}, - {"key": "0xA01E", "datatype": "int16", "remark": "BCU电压检测模块出现问题告警 R u 0:正常 1:告警"}, - {"key": "0xA01F", "datatype": "int16", "remark": "BCU温度检测模块出现问题告警 R u 0:正常 1:告警"}, - {"key": "0xA020", "datatype": "int16", "remark": "BCU电流检测模块出现问题告警 R u 0:正常 1:告警"}, - {"key": "0xA021", "datatype": "int16", "remark": "BCU绝缘检测模块出现问题告警 R u 0:正常 1:告警"}, - {"key": "0xA022", "datatype": "int16", "remark": "高压盒内总压检测模块出现问题告警 R u 0:正常 1:告警"}, - {"key": "0xA023", "datatype": "int16", "remark": "高压盒外总压检测模块出现问题告警 R u 0:正常 1:告警"}, - {"key": "0xA024", "datatype": "int16", "remark": "PCS-CAN通信故障告警 R u 0:正常 1:告警"}, - {"key": "0xA025", "datatype": "int16", "remark": "高压盒供电电压过高告警 R u 0:正常 1:告警"}, - {"key": "0xA026", "datatype": "int16", "remark": "绝缘正极故障告警 R u 0:正常 1:告警"}, - {"key": "0xA027", "datatype": "int16", "remark": "绝缘负极故障告警 R u 0:正常 1:告警"}, - {"key": "0xA028", "datatype": "int16", "remark": "绝缘中间侧故障告警 R u 0:正常 1:告警"}, - {"key": "0xA029", "datatype": "int16", "remark": "绝缘故障告警 R u 0:正常 1:告警"}, - {"key": "0xA02A", "datatype": "int16", "remark": "BMU中电压采样线开路告警 R u 0:正常 1:告警"}, - {"key": "0xA02B", "datatype": "int16", "remark": "BMU中NTC采样线短开路告警 R u 0:正常 1:告警"}, - {"key": "0xA02C", "datatype": "int16", "remark": "BMU中采样芯片故障告警 R u 0:正常 1:告警"}, - {"key": "0xA02D", "datatype": "int16", "remark": "BMU中电池温度升高过快告警 R u 0:正常 1:告警"}, - {"key": "0xA02E", "datatype": "int16", "remark": "BMU中电池内部短路告警 R u 0:正常 1:告警"}, - {"key": "0xA02F", "datatype": "int16", "remark": "BMU充电均衡模块出现故障告警 R u 0:正常 1:告警"}, - {"key": "0xA030", "datatype": "int16", "remark": "BMU放电均衡模块出现故障告警 R u 0:正常 1:告警"}, - {"key": "0xA031", "datatype": "int16", "remark": "BMU通信故障告警 R u 0:正常 1:告警"}, - {"key": "0xA032", "datatype": "int16", "remark": "单体内阻过大告警 R u 0:正常 1:告警"}, - {"key": "0xA033", "datatype": "int16", "remark": "单体内阻过小告警 R u 0:正常 1:告警"}, - {"key": "0xA034", "datatype": "int16", "remark": "单体内阻阻差过大告警 R u 0:正常 1:告警"}, - {"key": "0xA035", "datatype": "int16", "remark": "簇内阻过大告警 R u 0:正常 1:告警"}, - {"key": "0xA036", "datatype": "int16", "remark": "簇内阻过小告警 R u 0:正常 1:告警"}, - {"key": "0xA037", "datatype": "int16", "remark": "SOC初始化无效告警 R u 0:正常 1:告警"}, - {"key": "0xA038", "datatype": "int16", "remark": "充电时soc降低故障告警 R u 0:正常 1:告警"}, - {"key": "0xA039", "datatype": "int16", "remark": "放电时soc升高告警 R u 0:正常 1:告警"}, - {"key": "0xA03A", "datatype": "int16", "remark": "静止时SOC跳变告警 R u 0:正常 1:告警"}, - {"key": "0xA03B", "datatype": "int16", "remark": "整簇总电压过高保护 R u 0:正常 1:保护"}, - {"key": "0xA03C", "datatype": "int16", "remark": "整簇总电压过低保护 R u 0:正常 1:保护"}, - {"key": "0xA03D", "datatype": "int16", "remark": "整簇中单体电压过高保护 R u 0:正常 1:保护"}, - {"key": "0xA03E", "datatype": "int16", "remark": "整簇中单体电压过低保护 R u 0:正常 1:保护"}, - {"key": "0xA03F", "datatype": "int16", "remark": "整簇中单体电压偏差过大保护 R u 0:正常 1:保护"}, - {"key": "0xA040", "datatype": "int16", "remark": "整簇中单体温度偏差过大保护 R u 0:正常 1:保护"}, - {"key": "0xA041", "datatype": "int16", "remark": "整簇中单体温度过高保护 R u 0:正常 1:保护"}, - {"key": "0xA042", "datatype": "int16", "remark": "整簇中单体温度过低保护 R u 0:正常 1:保护"}, - {"key": "0xA043", "datatype": "int16", "remark": "整簇总充电电流过高保护 R u 0:正常 1:保护"}, - {"key": "0xA044", "datatype": "int16", "remark": "整簇总放电电流过高保护 R u 0:正常 1:保护"}, - {"key": "0xA045", "datatype": "int16", "remark": "整簇总SOC过高保护 R u 0:正常 1:保护"}, - {"key": "0xA046", "datatype": "int16", "remark": "整簇总SOC过低保护 R u 0:正常 1:保护"}, - {"key": "0xA047", "datatype": "int16", "remark": "高压盒主正接触器粘连保护 R u 0:正常 1:保护"}, - {"key": "0xA048", "datatype": "int16", "remark": "高压盒主正接触器不能吸合保护 R u 0:正常 1:保护"}, - {"key": "0xA049", "datatype": "int16", "remark": "高压盒主负接触器粘连保护 R u 0:正常 1:保护"}, - {"key": "0xA04A", "datatype": "int16", "remark": "高压盒主负接触器不能吸合保护 R u 0:正常 1:保护"}, - {"key": "0xA04B", "datatype": "int16", "remark": "高压盒预充接触器粘连保护 R u 0:正常 1:保护"}, - {"key": "0xA04C", "datatype": "int16", "remark": "高压盒预充接触器不能吸合保护 R u 0:正常 1:保护"}, - {"key": "0xA04D", "datatype": "int16", "remark": "预充失败保护 R u 0:正常 1:保护"}, - {"key": "0xA04E", "datatype": "int16", "remark": "BCU电压检测模块出现问题保护 R u 0:正常 1:保护"}, - {"key": "0xA04F", "datatype": "int16", "remark": "BCU温度检测模块出现问题保护 R u 0:正常 1:保护"}, - {"key": "0xA050", "datatype": "int16", "remark": "BCU电流检测模块出现问题保护 R u 0:正常 1:保护"}, - {"key": "0xA051", "datatype": "int16", "remark": "BCU绝缘检测模块出现问题保护 R u 0:正常 1:保护"}, - {"key": "0xA052", "datatype": "int16", "remark": "高压盒内总压检测模块出现问题保护 R u 0:正常 1:保护"}, - {"key": "0xA053", "datatype": "int16", "remark": "高压盒外总压检测模块出现问题保护 R u 0:正常 1:保护"}, - {"key": "0xA054", "datatype": "int16", "remark": "PCS-CAN通信故障保护 R u 0:正常 1:保护"}, - {"key": "0xA055", "datatype": "int16", "remark": "高压盒供电电压过高保护 R u 0:正常 1:保护"}, - {"key": "0xA056", "datatype": "int16", "remark": "绝缘正极故障保护 R u 0:正常 1:保护"}, - {"key": "0xA057", "datatype": "int16", "remark": "绝缘负极故障保护 R u 0:正常 1:保护"}, - {"key": "0xA058", "datatype": "int16", "remark": "绝缘中间侧故障保护 R u 0:正常 1:保护"}, - {"key": "0xA059", "datatype": "int16", "remark": "绝缘故障保护 R u 0:正常 1:保护"}, - {"key": "0xA05A", "datatype": "int16", "remark": "BMU中电压采样线开路保护 R u 0:正常 1:保护"}, - {"key": "0xA05B", "datatype": "int16", "remark": "BMU中NTC采样线短开路保护 R u 0:正常 1:保护"}, - {"key": "0xA05C", "datatype": "int16", "remark": "BMU中采样芯片故障保护 R u 0:正常 1:保护"}, - {"key": "0xA05D", "datatype": "int16", "remark": "BMU中电池温度升高过快保护 R u 0:正常 1:保护"}, - {"key": "0xA05E", "datatype": "int16", "remark": "BMU中电池内部短路保护 R u 0:正常 1:保护"}, - {"key": "0xA05F", "datatype": "int16", "remark": "BMU充电均衡模块出现故障保护 R u 0:正常 1:保护"}, - {"key": "0xA060", "datatype": "int16", "remark": "BMU放电均衡模块出现故障保护 R u 0:正常 1:保护"}, - {"key": "0xA061", "datatype": "int16", "remark": "BMU通信故障保护 R u 0:正常 1:保护"}, - {"key": "0xA062", "datatype": "int16", "remark": "单体内阻过大保护 R u 0:正常 1:保护"}, - {"key": "0xA063", "datatype": "int16", "remark": "单体内阻过小保护 R u 0:正常 1:保护"}, - {"key": "0xA064", "datatype": "int16", "remark": "单体内阻阻差过大保护 R u 0:正常 1:保护"}, - {"key": "0xA065", "datatype": "int16", "remark": "簇内阻过大保护 R u 0:正常 1:保护"}, - {"key": "0xA066", "datatype": "int16", "remark": "簇内阻过小保护 R u 0:正常 1:保护"}, - {"key": "0xA067", "datatype": "int16", "remark": "SOC初始化无效保护 R u 0:正常 1:保护"}, - {"key": "0xA068", "datatype": "int16", "remark": "充电时soc降低故障保护 R u 0:正常 1:保护"}, - {"key": "0xA069", "datatype": "int16", "remark": "放电时soc升高保护 R u 0:正常 1:保护"}, - {"key": "0xA06A", "datatype": "int16", "remark": "静止时SOC跳变保护 R u 0:正常 1:保护"} + {"key": "0x2001", "datatype": "uint16", "remark": "BMS(电池堆)通信状态0:正常1:故障"}, + {"key": "0x2002", "datatype": "uint64", "remark": "BCU(电池簇)通信状态0:正常1:故障"}, + {"key": "0x2006", "datatype": "uint16", "remark": "PCU(主控)通信状态0:正常1:故障"}, + {"key": "0x2007", "datatype": "uint64", "remark": "PCS(模块)通信状态0:正常1:故障"}, + {"key": "0x200B", "datatype": "uint16", "remark": "电表总接点通信状态0:正常1:故障"}, + {"key": "0x200C", "datatype": "uint32", "remark": "电表通信状态0:正常1:故障"}, + {"key": "0x200E", "datatype": "uint16", "remark": "消防通信状态0:正常1:故障"}, + {"key": "0x200F", "datatype": "uint16", "remark": "UPS通信状态0:正常1:故障"}, + {"key": "0x2010", "datatype": "uint16", "remark": "温湿度总接点通信状态0:正常1:故障"}, + {"key": "0x2011", "datatype": "uint32", "remark": "温湿度通信状态0:正常1:故障"}, + {"key": "0x2013", "datatype": "uint16", "remark": "空调总接点通信状态0:正常1:故障"}, + {"key": "0x2014", "datatype": "uint32", "remark": "空调通信状态0:正常1:故障"}, + {"key": "0x2016", "datatype": "uint16", "remark": "控制干接点(配电系统)状态0:开路1:闭合"}, + {"key": "0x2017", "datatype": "uint16", "remark": "状态干接点(配电系统)状态0:开路1:闭合"}, + {"key": "0x2018", "datatype": "uint16", "remark": "BCU总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x2019", "datatype": "uint16", "remark": "PCU总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x201A", "datatype": "uint16", "remark": "电表总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x201B", "datatype": "uint16", "remark": "消防总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x201C", "datatype": "uint16", "remark": "UPS总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x201D", "datatype": "uint16", "remark": "温湿度总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x201E", "datatype": "uint16", "remark": "空调总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x201F", "datatype": "uint16", "remark": "EMU通信状态0:正常 1:告警 2:故障"}, + {"key": "0x2020", "datatype": "uint16", "remark": "冷机总通信状态0:正常 1:告警 2:故障"}, + {"key": "0x2021", "datatype": "uint16", "remark": "冷机总接点通信状态0:正常1:故障"}, + {"key": "0x2022", "datatype": "uint16", "remark": "冷机通信状态0:正常1:故障"}, + {"key": "0x207A", "datatype": "uint16", "remark": "判断总表的三相总有功 < -5.0fkW 充电 >5.0fkW放电 否则停机0:充电 1:放电 2:停机"} ] }, - "BCU_YC": { - "count":1, + "EMS_YC":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属通道号 R u 1~4"}, - {"key": "0x0002", "datatype": "int16", "remark": "所属BCU号 R u 1~40"}, - {"key": "0x0003", "datatype": "int32", "remark": "簇电压 R u 0.1V"}, - {"key": "0x0005", "datatype": "int32", "remark": "簇电流 R 0.1A"}, - {"key": "0x0007", "datatype": "int32", "remark": "簇温度 R 0.1℃"}, - {"key": "0x0009", "datatype": "int32", "remark": "簇电阻 R u 1mΩ"}, - {"key": "0x000B", "datatype": "int16", "remark": "簇SOC R u 0.1"}, - {"key": "0x000C", "datatype": "int16", "remark": "簇SOH R u 0.1"}, - {"key": "0x000D", "datatype": "int32", "remark": "簇正绝缘电阻 R u 1kΩ"}, - {"key": "0x000F", "datatype": "int32", "remark": "簇负绝缘电阻 R u 1kΩ"}, - {"key": "0x0011", "datatype": "int32", "remark": "簇允许最大充电电流 R 0.1A"}, - {"key": "0x0013", "datatype": "int32", "remark": "簇允许最大放电电流 R 0.1A"}, - {"key": "0x0015", "datatype": "int32", "remark": "簇允许最大充电功率 R u 1kW"}, - {"key": "0x0017", "datatype": "int32", "remark": "簇允许最大放电功率 R u 1kW"}, - {"key": "0x0019", "datatype": "int32", "remark": "簇可充容量 R u 0.1Ah"}, - {"key": "0x001B", "datatype": "int32", "remark": "簇可放容量 R u 0.1Ah"}, - {"key": "0x001D", "datatype": "int32", "remark": "簇单次累计充容量 R u 0.1Ah"}, - {"key": "0x001F", "datatype": "int32", "remark": "簇单次累计放容量 R u 0.1Ah"}, - {"key": "0x0021", "datatype": "int32", "remark": "簇总累计充容量 R u 0.1Ah"}, - {"key": "0x0023", "datatype": "int32", "remark": "簇总累计放容量 R u 0.1Ah"}, - {"key": "0x0025", "datatype": "int32", "remark": "簇可充电量 R u 1kWh"}, - {"key": "0x0027", "datatype": "int32", "remark": "簇可放电量 R u 1kWh"}, - {"key": "0x0029", "datatype": "int32", "remark": "簇单次充电量 R u 1kWh"}, - {"key": "0x002B", "datatype": "int32", "remark": "簇单次放电量 R u 1kWh"}, - {"key": "0x002D", "datatype": "int32", "remark": "簇累计充电量 R u 1kWh"}, - {"key": "0x002F", "datatype": "int32", "remark": "簇累计放电量 R u 1kWh"}, - {"key": "0x0031", "datatype": "int32", "remark": "pack累计簇总压 R u 0.1V"}, - {"key": "0x0033", "datatype": "int32", "remark": "簇与pack压差 R u 0.1V"}, - {"key": "0x0035", "datatype": "int32", "remark": "簇与PCS压差 R u 0.1V"}, - {"key": "0x0037", "datatype": "int16", "remark": "簇中BMU个数 R u"}, - {"key": "0x0038", "datatype": "int16", "remark": "簇中BMU中单体个数 R u"}, - {"key": "0x0039", "datatype": "int16", "remark": "簇中BMU中温度个数 R u"}, - {"key": "0x003A", "datatype": "int16", "remark": "簇中单体个数 R u"}, - {"key": "0x003B", "datatype": "int16", "remark": "簇中温度个数 R u"}, - {"key": "0x003C", "datatype": "int16", "remark": "单体最高SOC节号 R u"}, - {"key": "0x003D", "datatype": "int16", "remark": "单体最高SOC R u 0.1"}, - {"key": "0x003E", "datatype": "int16", "remark": "单体最低SOC节号 R u"}, - {"key": "0x003F", "datatype": "int16", "remark": "单体最低SOC R u 0.1"}, - {"key": "0x0040", "datatype": "int16", "remark": "单体最高SOH节号 R u"}, - {"key": "0x0041", "datatype": "int16", "remark": "单体最高SOH R u 0.1"}, - {"key": "0x0042", "datatype": "int16", "remark": "单体最低SOH节号 R u"}, - {"key": "0x0043", "datatype": "int16", "remark": "单体最低SOH R u 0.1"}, - {"key": "0x0044", "datatype": "int16", "remark": "单体最高电压节号 R u"}, - {"key": "0x0045", "datatype": "int16", "remark": "单体最高电压 R u mV"}, - {"key": "0x0046", "datatype": "int16", "remark": "单体最低电压节号 R u"}, - {"key": "0x0047", "datatype": "int16", "remark": "单体最低电压 R u mV"}, - {"key": "0x0048", "datatype": "int16", "remark": "单体电压差 R u mV"}, - {"key": "0x0049", "datatype": "int16", "remark": "单体平均电压 R u mV"}, - {"key": "0x004A", "datatype": "int16", "remark": "单体最高温度节号 R u"}, - {"key": "0x004B", "datatype": "int16", "remark": "单体最高温度 R 0.1℃"}, - {"key": "0x004C", "datatype": "int16", "remark": "单体最低温度节号 R u"}, - {"key": "0x004D", "datatype": "int16", "remark": "单体最低温度 R 0.1℃"}, - {"key": "0x004E", "datatype": "int16", "remark": "单体温度差 R 0.1℃"}, - {"key": "0x004F", "datatype": "int16", "remark": "单体平均温度 R 0.1℃"}, - {"key": "0x0050", "datatype": "int16", "remark": "单体最高内阻节号 R u"}, - {"key": "0x0051", "datatype": "int16", "remark": "单体最高内阻 R u mΩ"}, - {"key": "0x0052", "datatype": "int16", "remark": "单体最低内阻节号 R u"}, - {"key": "0x0053", "datatype": "int16", "remark": "单体最低内阻 R u mΩ"}, - {"key": "0x0054", "datatype": "int16", "remark": "单体内阻差 R u mΩ"}, - {"key": "0x0055", "datatype": "int16", "remark": "单体平均内阻 R u mΩ"}, - {"key": "0x0056", "datatype": "int16", "remark": "单体SOC R u[1000] 0.1"}, - {"key": "0x043E", "datatype": "int16", "remark": "单体SOH R u[1000] 0.1"}, - {"key": "0x0826", "datatype": "int16", "remark": "单体电压 R u[1000] mV"}, - {"key": "0x0C0E", "datatype": "int16", "remark": "单体温度 R [1000] 0.01℃"}, - {"key": "0x0FF6", "datatype": "int16", "remark": "单体内阻 R u[1000] mΩ"} + {"key": "0x1001", "datatype": "uint16", "remark": "BMS(电池堆)个数1"}, + {"key": "0x1002", "datatype": "uint16", "remark": "BCU通道个数1~2"}, + {"key": "0x1003", "datatype": "uint16", "remark": "BCU(电池簇)个数1~40"}, + {"key": "0x1004", "datatype": "uint16", "remark": "PCU(主控)个数1~4"}, + {"key": "0x1005", "datatype": "uint16", "remark": "PCU通道个数1~4"}, + {"key": "0x1006", "datatype": "uint16", "remark": "PCS(模块)个数1~40"}, + {"key": "0x1007", "datatype": "uint16", "remark": "电表通道个数1"}, + {"key": "0x1008", "datatype": "uint16", "remark": "电表个数1~10"}, + {"key": "0x1009", "datatype": "uint16", "remark": "消防通道个数1~10"}, + {"key": "0x100A", "datatype": "uint16", "remark": "消防个数1~10"}, + {"key": "0x100B", "datatype": "uint16", "remark": "UPS通道个数1~10"}, + {"key": "0x100C", "datatype": "uint16", "remark": "UPS个数1~10"}, + {"key": "0x100D", "datatype": "uint16", "remark": "温湿度通道个数1"}, + {"key": "0x100E", "datatype": "uint16", "remark": "温湿度个数1~10"}, + {"key": "0x100F", "datatype": "uint16", "remark": "空调通道个数1"}, + {"key": "0x1010", "datatype": "uint16", "remark": "空调个数1~10"}, + {"key": "0x1011", "datatype": "uint16", "remark": "控制干接点(配电系统)个数16"}, + {"key": "0x1012", "datatype": "uint16", "remark": "状态干接点(配电系统)个数16"}, + {"key": "0x1072", "datatype": "uint32", "remark": "系统最大可充电功率(1KW)"}, + {"key": "0x1074", "datatype": "uint32", "remark": "系统最大可放电功率(1KW)"}, + {"key": "0x1076", "datatype": "uint32", "remark": "储能母线电压(0.1V)"}, + {"key": "0x1078", "datatype": "int32", "remark": "储能母线电流(0.1A)"}, + {"key": "0x107A", "datatype": "uint16", "remark": "储能系统SOC(0.1)"}, + {"key": "0x107B", "datatype": "uint16", "remark": "储能系统SOH(0.1)"}, + {"key": "0x107C", "datatype": "uint16", "remark": "电流变比"}, + {"key": "0x107D", "datatype": "uint16", "remark": "电压变比"}, + {"key": "0x107E", "datatype": "uint32", "remark": "A相电压(1V)"}, + {"key": "0x1080", "datatype": "uint32", "remark": "B相电压(1V)"}, + {"key": "0x1082", "datatype": "uint32", "remark": "C相电压(1V)"}, + {"key": "0x1084", "datatype": "int32", "remark": "A相电流(1A)"}, + {"key": "0x1086", "datatype": "int32", "remark": "B相电流(1A)"}, + {"key": "0x1088", "datatype": "int32", "remark": "C相电流(1A)"}, + {"key": "0x108A", "datatype": "uint32", "remark": "AB相电压(1V)"}, + {"key": "0x108C", "datatype": "uint32", "remark": "BC相电压(1V)"}, + {"key": "0x108E", "datatype": "uint32", "remark": "CA相电压(1V)"}, + {"key": "0x1090", "datatype": "int32", "remark": "A相有功功率(1kW)"}, + {"key": "0x1092", "datatype": "int32", "remark": "B相有功功率(1kW)"}, + {"key": "0x1094", "datatype": "int32", "remark": "C相有功功率(1kW)"}, + {"key": "0x1096", "datatype": "int32", "remark": "三相总有功功率(1kW)"}, + {"key": "0x1098", "datatype": "int32", "remark": "当前控制功率(0.1kW)"}, + {"key": "0x109A", "datatype": "uint32", "remark": "负荷率(0.01)"}, + {"key": "0x109C", "datatype": "uint32", "remark": "三相不平衡度(0.01)"}, + {"key": "0x109E", "datatype": "uint32", "remark": "功率因素比率(0.01)"}, + {"key": "0x10A0", "datatype": "int32", "remark": "进线开关柜功率(1kW)"}, + {"key": "0x10A2", "datatype": "int32", "remark": "用户关口表功率(1kW)"}, + {"key": "0x1104", "datatype": "int32", "remark": "正向总有功总需量(1kW)"}, + {"key": "0x1106", "datatype": "uint32", "remark": "尖段电价(1RMB)"}, + {"key": "0x1108", "datatype": "uint32", "remark": "峰段电价(1RMB)"}, + {"key": "0x110A", "datatype": "uint32", "remark": "平段电价(1RMB)"}, + {"key": "0x110C", "datatype": "uint32", "remark": "谷段电价(1RMB)"}, + {"key": "0x110E", "datatype": "uint32", "remark": "日充电电量(1kWh)"}, + {"key": "0x1110", "datatype": "uint32", "remark": "日放电电量(1kWh)"}, + {"key": "0x1112", "datatype": "uint32", "remark": "日充电费用(1RMB)"}, + {"key": "0x1114", "datatype": "uint32", "remark": "日放电费用(1RMB)"}, + {"key": "0x1116", "datatype": "int32", "remark": "日收益(1RMB)"}, + {"key": "0x1118", "datatype": "uint32", "remark": "日正向尖有功电能(1kWh)"}, + {"key": "0x111A", "datatype": "uint32", "remark": "日正向峰有功电能(1kWh)"}, + {"key": "0x111C", "datatype": "uint32", "remark": "日正向平有功电能(1kWh)"}, + {"key": "0x111E", "datatype": "uint32", "remark": "日正向谷有功电能(1kWh)"}, + {"key": "0x1120", "datatype": "uint32", "remark": "日正向总有功电能(1kWh)"}, + {"key": "0x1122", "datatype": "uint32", "remark": "日反向尖有功电能(1kWh)"}, + {"key": "0x1124", "datatype": "uint32", "remark": "日反向峰有功电能(1kWh)"}, + {"key": "0x1126", "datatype": "uint32", "remark": "日反向平有功电能(1kWh)"}, + {"key": "0x1128", "datatype": "uint32", "remark": "日反向谷有功电能(1kWh)"}, + {"key": "0x112A", "datatype": "uint32", "remark": "日反向总有功电能(1kWh)"}, + {"key": "0x112C", "datatype": "uint32", "remark": "总充电电量(1kWh)"}, + {"key": "0x112E", "datatype": "uint32", "remark": "总放电电量(1kWh)"}, + {"key": "0x1130", "datatype": "uint32", "remark": "总充电费用(1RMB)"}, + {"key": "0x1132", "datatype": "uint32", "remark": "总放电费用(1RMB)"}, + {"key": "0x1134", "datatype": "int32", "remark": "总收益(1RMB)"}, + {"key": "0x1136", "datatype": "uint32", "remark": "总正向尖有功电能(1kWh)"}, + {"key": "0x1138", "datatype": "uint32", "remark": "总正向峰有功电能(1kWh)"}, + {"key": "0x113A", "datatype": "uint32", "remark": "总正向平有功电能(1kWh)"}, + {"key": "0x113C", "datatype": "uint32", "remark": "总正向谷有功电能(1kWh)"}, + {"key": "0x113E", "datatype": "uint32", "remark": "总正向总有功电能(1kWh)"}, + {"key": "0x1140", "datatype": "uint32", "remark": "总反向尖有功电能(1kWh)"}, + {"key": "0x1142", "datatype": "uint32", "remark": "总反向峰有功电能(1kWh)"}, + {"key": "0x1144", "datatype": "uint32", "remark": "总反向平有功电能(1kWh)"}, + {"key": "0x1146", "datatype": "uint32", "remark": "总反向谷有功电能(1kWh)"}, + {"key": "0x1148", "datatype": "uint32", "remark": "总反向总有功电能(1kWh)"}, + {"key": "0x11AE", "datatype": "int16", "remark": "交流A相电压(1V)"}, + {"key": "0x11AF", "datatype": "int16", "remark": "交流B相电压(1V)"}, + {"key": "0x11B0", "datatype": "int16", "remark": "交流C相电压(1V)"}, + {"key": "0x11B1", "datatype": "int16", "remark": "交流A相频率(1Hz)"}, + {"key": "0x11B2", "datatype": "int16", "remark": "交流B相频率(1Hz)"}, + {"key": "0x11B3", "datatype": "int16", "remark": "交流C相频率(1Hz)"}, + {"key": "0x11B4", "datatype": "int32", "remark": "总直流功率(1kW)"}, + {"key": "0x11B6", "datatype": "uint32", "remark": "总直流电压(0.1V)"}, + {"key": "0x11B8", "datatype": "int32", "remark": "总直流电流(0.1A)"}, + {"key": "0x121B", "datatype": "int16", "remark": "储能系统温度(0.1℃)"}, + {"key": "0x121C", "datatype": "uint16", "remark": "储能充放电时段hh(时)"}, + {"key": "0x121D", "datatype": "uint16", "remark": "储能充放电时段mm(分)"}, + {"key": "0x121E", "datatype": "uint16", "remark": "储能充放电时段ss(秒)"} ] }, - "BMS_YC": { - "count":1, + "PCU_YC":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "SOC R u 0.1"}, - {"key": "0x0002", "datatype": "int16", "remark": "SOH R u 0.1"}, - {"key": "0x0003", "datatype": "int32", "remark": "电压 R u 0.1V"}, - {"key": "0x0005", "datatype": "int32", "remark": "电流 R 0.1A"}, - {"key": "0x0007", "datatype": "int32", "remark": "可充电量 R u 1kWh"}, - {"key": "0x0009", "datatype": "int32", "remark": "可放电量 R u 1kWh"}, - {"key": "0x000B", "datatype": "int32", "remark": "单次可充电量 R u 1kWh"}, - {"key": "0x000D", "datatype": "int32", "remark": "单次可放电量 R u 1kWh"}, - {"key": "0x000F", "datatype": "int32", "remark": "堆功率 R 1kW"}, - {"key": "0x0011", "datatype": "int32", "remark": "充电量累加 R u 1kWh"}, - {"key": "0x0013", "datatype": "int32", "remark": "放电量累加 R u 1kWh"}, - {"key": "0x0015", "datatype": "int16", "remark": "簇最大SOC R u 0.1"}, - {"key": "0x0016", "datatype": "int16", "remark": "簇最小SOC R u 0.1"}, - {"key": "0x0017", "datatype": "int16", "remark": "簇最大SOC号 R u"}, - {"key": "0x0018", "datatype": "int16", "remark": "簇最小SOC号 R u"}, - {"key": "0x0019", "datatype": "int16", "remark": "簇SOC差值 R u 0.1"}, - {"key": "0x001A", "datatype": "int16", "remark": "簇最大电压 R u 0.1V"}, - {"key": "0x001B", "datatype": "int16", "remark": "簇最小电压 R u 0.1V"}, - {"key": "0x001C", "datatype": "int16", "remark": "簇最大电压号 R u"}, - {"key": "0x001D", "datatype": "int16", "remark": "簇最小电压号 R u"}, - {"key": "0x001E", "datatype": "int16", "remark": "簇电压差值 R u 0.1V"}, - {"key": "0x001F", "datatype": "int16", "remark": "单体最大电压簇号 R u"}, - {"key": "0x0020", "datatype": "int16", "remark": "单体最大电压节号 R u"}, - {"key": "0x0021", "datatype": "int16", "remark": "单体最大电压 R u mV"}, - {"key": "0x0022", "datatype": "int16", "remark": "单体最小电压簇号 R u"}, - {"key": "0x0023", "datatype": "int16", "remark": "单体最小电压节号 R u"}, - {"key": "0x0024", "datatype": "int16", "remark": "单体最小电压 R u mV"}, - {"key": "0x0025", "datatype": "int16", "remark": "单体平均电压 R u mV"}, - {"key": "0x0026", "datatype": "int16", "remark": "单体电压差 R u mV"}, - {"key": "0x0027", "datatype": "int16", "remark": "单体最大温度簇号 R u"}, - {"key": "0x0028", "datatype": "int16", "remark": "单体最大温度节号 R u"}, - {"key": "0x0029", "datatype": "int16", "remark": "单体最大温度 R 0.1℃"}, - {"key": "0x002A", "datatype": "int16", "remark": "单体最小温度簇号 R u"}, - {"key": "0x002B", "datatype": "int16", "remark": "单体最小温度节号 R u"}, - {"key": "0x002C", "datatype": "int16", "remark": "单体最小温度 R 0.1℃"}, - {"key": "0x002D", "datatype": "int16", "remark": "单体平均温度 R 0.1℃"}, - {"key": "0x002E", "datatype": "int16", "remark": "单体温度差 R 0.1℃"}, - {"key": "0x002F", "datatype": "int16", "remark": "最大内阻簇号 R u"}, - {"key": "0x0030", "datatype": "int16", "remark": "最大内阻节号 R u"}, - {"key": "0x0031", "datatype": "int16", "remark": "最大内阻 R u mΩ"}, - {"key": "0x0032", "datatype": "int16", "remark": "最小内阻簇号 R u"}, - {"key": "0x0033", "datatype": "int16", "remark": "最小内阻节号 R u"}, - {"key": "0x0034", "datatype": "int16", "remark": "最小内阻 R u mΩ"}, - {"key": "0x0035", "datatype": "int16", "remark": "单体平均内阻 R u mΩ"}, - {"key": "0x0036", "datatype": "int16", "remark": "单体内阻差 R u mΩ"}, - {"key": "0x0037", "datatype": "int16", "remark": "单体最大SOH簇号 R u"}, - {"key": "0x0038", "datatype": "int16", "remark": "单体最大SOH节号 R u"}, - {"key": "0x0039", "datatype": "int16", "remark": "单体最大SOH R u 0.10%"}, - {"key": "0x003A", "datatype": "int16", "remark": "单体最小SOH簇号 R u"}, - {"key": "0x003B", "datatype": "int16", "remark": "单体最小SOH节号 R u"}, - {"key": "0x003C", "datatype": "int16", "remark": "单体最小SOH R u 0.10%"}, - {"key": "0x003D", "datatype": "int16", "remark": "单体最大SOc簇号 R u"}, - {"key": "0x003E", "datatype": "int16", "remark": "单体最大SOc节号 R u"}, - {"key": "0x0040", "datatype": "int16", "remark": "单体最大Soc R u 0.10%"}, - {"key": "0x0041", "datatype": "int16", "remark": "单体最小SOc簇号 R u"}, - {"key": "0x0042", "datatype": "int16", "remark": "单体最小SOc节号 R u"}, - {"key": "0x0043", "datatype": "int16", "remark": "单体最小SOc R u 0.10%"}, - {"key": "0x0043", "datatype": "int32", "remark": "系统剩余最大可充电功率 R u 1KW"}, - {"key": "0x0045", "datatype": "int32", "remark": "系统剩余最大可放电功率 R u 1KW"}, - {"key": "0x0047", "datatype": "int16", "remark": "可充电状态 R u 1:可充电;0:不可充电"}, - {"key": "0x0048", "datatype": "int16", "remark": "可放电状态 R u 1:可放电;0:不可放电"}, - {"key": "0x0049", "datatype": "int16", "remark": "运行状态 R u 运行状态 0-正常 1-告警 2-保护"}, - {"key": "0x004A", "datatype": "int16", "remark": "充放电状态 R u 0-待机 1-充电 2-放电"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属通道号1~4"}, + {"key": "0x0002", "datatype": "uint32", "remark": "充电功率最大许可(1KW)"}, + {"key": "0x0004", "datatype": "uint32", "remark": "放电功率最大许可(1KW)"}, + {"key": "0x0006", "datatype": "uint32", "remark": "交流日总充电量(1KWh)"}, + {"key": "0x0008", "datatype": "uint32", "remark": "交流日总放电量(1KWh)"}, + {"key": "0x000A", "datatype": "uint32", "remark": "交流总充电量(1KWh)"}, + {"key": "0x000C", "datatype": "uint32", "remark": "交流总放电量(1KWh)"}, + {"key": "0x000E", "datatype": "int16", "remark": "有功功率期望值(1KW)"}, + {"key": "0x000F", "datatype": "int16", "remark": "无功功率期望值(1kVar)"}, + {"key": "0x0010", "datatype": "int16", "remark": "PCS侧线电压VAB(1v)"}, + {"key": "0x0011", "datatype": "int16", "remark": "PCS侧线电压VBC(1v)"}, + {"key": "0x0012", "datatype": "int16", "remark": "PCS侧线电压VCA(1v)"}, + {"key": "0x0013", "datatype": "int16", "remark": "PCS侧线A相电压(1v)"}, + {"key": "0x0014", "datatype": "int16", "remark": "PCS侧线B相电压(1v)"}, + {"key": "0x0015", "datatype": "int16", "remark": "PCS侧线C相电压(1v)"}, + {"key": "0x0016", "datatype": "int16", "remark": "PCS侧A相频率(1Hz)"}, + {"key": "0x0017", "datatype": "int16", "remark": "PCS侧B相频率(1Hz)"}, + {"key": "0x0018", "datatype": "int16", "remark": "PCS侧C相频率(1Hz)"}, + {"key": "0x0019", "datatype": "int16", "remark": "PCS侧功率因数A(1)"}, + {"key": "0x001A", "datatype": "int16", "remark": "PCS侧功率因数B(1)"}, + {"key": "0x001B", "datatype": "int16", "remark": "PCS侧功率因数C(1)"}, + {"key": "0x001C", "datatype": "int16", "remark": "PCS侧相电流A(1A)"}, + {"key": "0x001D", "datatype": "int16", "remark": "PCS侧相电流B(1A)"}, + {"key": "0x001E", "datatype": "int16", "remark": "PCS侧相电流C(1A)"}, + {"key": "0x001F", "datatype": "int16", "remark": "PCS侧有功功率A(1kW)"}, + {"key": "0x0020", "datatype": "int16", "remark": "PCS侧有功功率B(1kW)"}, + {"key": "0x0021", "datatype": "int16", "remark": "PCS侧有功功率C(1kW)"}, + {"key": "0x0022", "datatype": "int16", "remark": "PCS侧无功功率A(1kVar)"}, + {"key": "0x0023", "datatype": "int16", "remark": "PCS侧无功功率B(1kVar)"}, + {"key": "0x0024", "datatype": "int16", "remark": "PCS侧无功功率C(1kVar)"}, + {"key": "0x0025", "datatype": "int16", "remark": "PCS侧视在功率A(1kVar)"}, + {"key": "0x0026", "datatype": "int16", "remark": "PCS侧视在功率B(1kVar)"}, + {"key": "0x0027", "datatype": "int16", "remark": "PCS侧视在功率C(1kVar)"}, + {"key": "0x0028", "datatype": "int16", "remark": "PCS侧三相总有功功率(1kW)"}, + {"key": "0x0029", "datatype": "int16", "remark": "PCS侧三相总无功功率(1kVar)"}, + {"key": "0x002A", "datatype": "int16", "remark": "PCS侧三相总视在功率(1kVA)"}, + {"key": "0x002B", "datatype": "int16", "remark": "PCS侧三相总功率因数(1)"}, + {"key": "0x002C", "datatype": "int16", "remark": "PCU模块温度(1℃)"}, + {"key": "0x002D", "datatype": "int16", "remark": "外部温度NTC1(1℃)"}, + {"key": "0x002E", "datatype": "int16", "remark": "外部温度NTC2(1℃)"}, + {"key": "0x002F", "datatype": "int16", "remark": "外部温度NTC3(1℃)"}, + {"key": "0x0030", "datatype": "int16", "remark": "台区负载侧A相电流(1A)"}, + {"key": "0x0031", "datatype": "int16", "remark": "台区负载侧B相电流(1A)"}, + {"key": "0x0032", "datatype": "int16", "remark": "台区负载侧C相电流(1A)"}, + {"key": "0x0033", "datatype": "int16", "remark": "台区负载侧A相有功功率(1kW)"}, + {"key": "0x0034", "datatype": "int16", "remark": "台区负载侧B相有功功率(1kW)"}, + {"key": "0x0035", "datatype": "int16", "remark": "台区负载侧C相有功功率(1kW)"}, + {"key": "0x0036", "datatype": "int16", "remark": "台区负载侧总有功功率(1kW)"}, + {"key": "0x0037", "datatype": "int16", "remark": "台区负载侧A相无功功率(1kVar)"}, + {"key": "0x0038", "datatype": "int16", "remark": "台区负载侧B相无功功率(1kVar)"}, + {"key": "0x0039", "datatype": "int16", "remark": "台区负载侧C相无功功率(1kVar)"}, + {"key": "0x003A", "datatype": "int16", "remark": "台区负载侧总无功功率(1kVar)"}, + {"key": "0x003B", "datatype": "int16", "remark": "台区负载侧A相视在功率(1kVA)"}, + {"key": "0x003C", "datatype": "int16", "remark": "台区负载侧B相视在功率(1kVA)"}, + {"key": "0x003D", "datatype": "int16", "remark": "台区负载侧C相视在功率(1kVA)"}, + {"key": "0x003E", "datatype": "int16", "remark": "台区负载侧总视在功率(1kVA)"}, + {"key": "0x003F", "datatype": "int16", "remark": "台区负载侧A相功率因数(1)"}, + {"key": "0x0040", "datatype": "int16", "remark": "台区负载侧B相功率因数(1)"}, + {"key": "0x0041", "datatype": "int16", "remark": "台区负载侧C相功率因数(1)"}, + {"key": "0x0042", "datatype": "int16", "remark": "台区负载侧总功率因数(1)"}, + {"key": "0x0043", "datatype": "int16", "remark": "负载侧线电压AB(1V)"}, + {"key": "0x0044", "datatype": "int16", "remark": "负载侧线电压BC(1V)"}, + {"key": "0x0045", "datatype": "int16", "remark": "负载侧线电压CA(1V)"}, + {"key": "0x0046", "datatype": "int16", "remark": "负载侧相电压AN(1V)"}, + {"key": "0x0047", "datatype": "int16", "remark": "负载侧相电压BN(1V)"}, + {"key": "0x0048", "datatype": "int16", "remark": "负载侧相电压CN(1V)"}, + {"key": "0x0049", "datatype": "int16", "remark": "负载侧A功率因素(1)"}, + {"key": "0x004A", "datatype": "int16", "remark": "负载侧B功率因素(1)"}, + {"key": "0x004B", "datatype": "int16", "remark": "负载侧C功率因素(1)"}, + {"key": "0x004C", "datatype": "int16", "remark": "负载侧A视在功率(1kVA)"}, + {"key": "0x004D", "datatype": "int16", "remark": "负载侧B视在功率(1kVA)"} ] }, - "EMS_YX": { - "count":1, + "PCU_YX":{ "addr":[ - {"key": "0x2001", "datatype": "int16", "remark": "BMS(电池堆)通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2002", "datatype": "int64", "remark": "BCU(电池簇)通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~64"}, - {"key": "0x2006", "datatype": "int16", "remark": "PCU(主控)通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2007", "datatype": "int64", "remark": "PCS(模块)通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~64"}, - {"key": "0x200B", "datatype": "int16", "remark": "电表总接点通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x200C", "datatype": "int32", "remark": "电表通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~32"}, - {"key": "0x200E", "datatype": "int16", "remark": "消防通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x200F", "datatype": "int16", "remark": "UPS通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2010", "datatype": "int16", "remark": "温湿度总接点通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2011", "datatype": "int32", "remark": "温湿度通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~32"}, - {"key": "0x2013", "datatype": "int16", "remark": "空调总接点通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2014", "datatype": "int32", "remark": "空调通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~32"}, - {"key": "0x2016", "datatype": "int16", "remark": "控制干接点(配电系统)状态 R u 0:开路1:闭合 bit位从低到高分别对应1~16"}, - {"key": "0x2017", "datatype": "int16", "remark": "状态干接点(配电系统)状态 R u 0:开路1:闭合 bit位从低到高分别对应1~16"}, - {"key": "0x2018", "datatype": "int16", "remark": "BCU总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x2019", "datatype": "int16", "remark": "PCU总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x201A", "datatype": "int16", "remark": "电表总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x201B", "datatype": "int16", "remark": "消防总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x201C", "datatype": "int16", "remark": "UPS总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x201D", "datatype": "int16", "remark": "温湿度总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x201E", "datatype": "int16", "remark": "空调总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x201F", "datatype": "int16", "remark": "EMU通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x2020", "datatype": "int16", "remark": "冷机总通信状态 R u 0:正常 1:告警 2:故障"}, - {"key": "0x2021", "datatype": "int16", "remark": "冷机总接点通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2022", "datatype": "int16", "remark": "冷机通信状态 R u 0:正常1:故障 bit位从低到高分别对应1~16"}, - {"key": "0x2023", "datatype": "", "remark": "预留"}, - {"key": "0x207A", "datatype": "int16", "remark": "预留判断总表的三相总有功 < -5.0fkW 充电 >5.0fkW放电 否则停机 R u 0:充电 1:放电 2:停机 储能状态"} + {"key": "0x1001", "datatype": "uint16", "remark": "所属通道号1~4"}, + {"key": "0x1002", "datatype": "uint16", "remark": "故障状态1故障,0正常"}, + {"key": "0x1003", "datatype": "uint16", "remark": "告警状态1告警,0正常"}, + {"key": "0x1004", "datatype": "uint16", "remark": "设备在线1在线,0无效"}, + {"key": "0x1005", "datatype": "uint16", "remark": "本地远程1本地,0远程"}, + {"key": "0x1006", "datatype": "uint16", "remark": "启停状态1开机,0关机"}, + {"key": "0x1007", "datatype": "uint16", "remark": "电网状态1离网,0并网"}, + {"key": "0x1008", "datatype": "uint16", "remark": "模块状态1开机,0待机"}, + {"key": "0x1009", "datatype": "uint16", "remark": "EPO急停1故障,0正常"}, + {"key": "0x100A", "datatype": "uint16", "remark": "防雷器异常1告警,0正常"}, + {"key": "0x100B", "datatype": "uint16", "remark": "负载电压反序1故障,0正常"}, + {"key": "0x100C", "datatype": "uint16", "remark": "市电电压反序1故障,0正常"}, + {"key": "0x100D", "datatype": "uint16", "remark": "输出相反序1故障,0正常"}, + {"key": "0x100E", "datatype": "uint16", "remark": "过载告警1告警,0正常"}, + {"key": "0x100F", "datatype": "uint16", "remark": "过载超时1故障,0正常"}, + {"key": "0x1010", "datatype": "uint16", "remark": "交流过流保护1故障,0正常"}, + {"key": "0x1011", "datatype": "uint16", "remark": "逆变电压异常1故障,0正常"}, + {"key": "0x1012", "datatype": "uint16", "remark": "内部串口异常1故障,0正常"}, + {"key": "0x1013", "datatype": "uint16", "remark": "485通信故障1故障,0正常"}, + {"key": "0x1014", "datatype": "uint16", "remark": "CAN通信故障1故障,0正常"}, + {"key": "0x1015", "datatype": "uint16", "remark": "E2PROM故障1故障,0正常"}, + {"key": "0x1016", "datatype": "uint16", "remark": "电网过压1故障,0正常"}, + {"key": "0x1017", "datatype": "uint16", "remark": "电网欠压1故障,0正常"}, + {"key": "0x1018", "datatype": "uint16", "remark": "电网过频1故障,0正常"}, + {"key": "0x1019", "datatype": "uint16", "remark": "电网欠频1故障,0正常"}, + {"key": "0x101A", "datatype": "uint16", "remark": "电网快检综合异常1故障,0正常"}, + {"key": "0x101B", "datatype": "uint16", "remark": "电网幅值快检异常1故障,0正常"}, + {"key": "0x101C", "datatype": "uint16", "remark": "电网拖尾异常1故障,0正常"}, + {"key": "0x101D", "datatype": "uint16", "remark": "消防输入信号NO1闭合,0断开"}, + {"key": "0x101E", "datatype": "uint16", "remark": "急停按钮信号NC1急停,0正常"}, + {"key": "0x101F", "datatype": "uint16", "remark": "避雷器NC1故障,0正常"}, + {"key": "0x1020", "datatype": "uint16", "remark": "避雷器断路器NC1故障,0正常"}, + {"key": "0x1021", "datatype": "uint16", "remark": "PCS总断路器NC1闭合,0断开"}, + {"key": "0x1022", "datatype": "uint16", "remark": "电操状态NO1闭合,0断开"}, + {"key": "0x1023", "datatype": "uint16", "remark": "远程关机NO1开机,0无效"}, + {"key": "0x1024", "datatype": "uint16", "remark": "远程开机NO1开机,0无效"}, + {"key": "0x1025", "datatype": "uint16", "remark": "BA故障信号NO1故障,0正常"}, + {"key": "0x1026", "datatype": "uint16", "remark": "PCS_01状态1在线,0掉线"}, + {"key": "0x1027", "datatype": "uint16", "remark": "PCS_02状态1在线,0掉线"}, + {"key": "0x1028", "datatype": "uint16", "remark": "PCS_03状态1在线,0掉线"}, + {"key": "0x1029", "datatype": "uint16", "remark": "PCS_04状态1在线,0掉线"}, + {"key": "0x102A", "datatype": "uint16", "remark": "PCS_05状态1在线,0掉线"}, + {"key": "0x102B", "datatype": "uint16", "remark": "PCS_06状态1在线,0掉线"}, + {"key": "0x102C", "datatype": "uint16", "remark": "PCS_07状态1在线,0掉线"}, + {"key": "0x102D", "datatype": "uint16", "remark": "PCS_09状态1在线,0掉线"}, + {"key": "0x102E", "datatype": "uint16", "remark": "PCS_10状态1在线,0掉线"}, + {"key": "0x102F", "datatype": "uint16", "remark": "PCS_01下发设置1故障,0正常"}, + {"key": "0x1030", "datatype": "uint16", "remark": "PCS_02下发设置1故障,0正常"}, + {"key": "0x1031", "datatype": "uint16", "remark": "PCS_03下发设置1故障,0正常"}, + {"key": "0x1032", "datatype": "uint16", "remark": "PCS_04下发设置1故障,0正常"}, + {"key": "0x1033", "datatype": "uint16", "remark": "PCS_05下发设置1故障,0正常"}, + {"key": "0x1034", "datatype": "uint16", "remark": "PCS_06下发设置1故障,0正常"}, + {"key": "0x1035", "datatype": "uint16", "remark": "PCS_07下发设置1故障,0正常"}, + {"key": "0x1036", "datatype": "uint16", "remark": "PCS_08下发设置1故障,0正常"}, + {"key": "0x1037", "datatype": "uint16", "remark": "PCS_09下发设置1故障,0正常"}, + {"key": "0x1038", "datatype": "uint16", "remark": "PCS_10下发设置1:故障,0正常"}, + {"key": "0x1039", "datatype": "uint16", "remark": "内部DSP通信故障1:故障,0正常"}, + {"key": "0x103A", "datatype": "uint16", "remark": "BMS CAN通信故障1:故障,0正常"} ] }, - "EMS_YC": { - "count":1, + "PCS_YC":{ "addr":[ - {"key": "0x1001", "datatype": "int16", "remark": "BMS(电池堆)个数 R u 1"}, - {"key": "0x1002", "datatype": "int16", "remark": "BCU通道个数 R u 1~2"}, - {"key": "0x1003", "datatype": "int16", "remark": "BCU(电池簇)个数 R u 1~40"}, - {"key": "0x1004", "datatype": "int16", "remark": "PCU(主控)个数 R u 1~4"}, - {"key": "0x1005", "datatype": "int16", "remark": "PCU通道个数 R u 1~4"}, - {"key": "0x1006", "datatype": "int16", "remark": "PCS(模块)个数 R u 1~40"}, - {"key": "0x1007", "datatype": "int16", "remark": "电表通道个数 R u 1"}, - {"key": "0x1008", "datatype": "int16", "remark": "电表个数 R u 1~10"}, - {"key": "0x1009", "datatype": "int16", "remark": "消防通道个数 R u 1~10"}, - {"key": "0x100A", "datatype": "int16", "remark": "消防个数 R u 1~10"}, - {"key": "0x100B", "datatype": "int16", "remark": "UPS通道个数 R u 1~10"}, - {"key": "0x100C", "datatype": "int16", "remark": "UPS个数 R u 1~10"}, - {"key": "0x100D", "datatype": "int16", "remark": "温湿度通道个数 R u 1"}, - {"key": "0x100E", "datatype": "int16", "remark": "温湿度个数 R u 1~10"}, - {"key": "0x100F", "datatype": "int16", "remark": "空调通道个数 R u 1"}, - {"key": "0x1010", "datatype": "int16", "remark": "空调个数 R u 1~10"}, - {"key": "0x1011", "datatype": "int16", "remark": "控制干接点(配电系统)个数 R u 16"}, - {"key": "0x1012", "datatype": "int16", "remark": "状态干接点(配电系统)个数 R u 16"}, - {"key": "0x1013", "datatype": "", "remark": "预留"}, - {"key": "0x1072", "datatype": "int32", "remark": "预留预留预留预留预留预留预留预留系统最大可充电功率 R u 1KW Pcu数据"}, - {"key": "0x1074", "datatype": "int32", "remark": "系统最大可放电功率 R u 1KW"}, - {"key": "0x1076", "datatype": "int32", "remark": "储能母线电压 R u 0.1V 堆数据"}, - {"key": "0x1078", "datatype": "int32", "remark": "储能母线电流 R 0.1A"}, - {"key": "0x107A", "datatype": "int16", "remark": "储能系统SOC R u 0.1"}, - {"key": "0x107B", "datatype": "int16", "remark": "储能系统SOH R u 0.1"}, - {"key": "0x107C", "datatype": "int16", "remark": "电流变比 R u 电表总表数据"}, - {"key": "0x107D", "datatype": "int16", "remark": "电压变比 R u"}, - {"key": "0x107E", "datatype": "int32", "remark": "A相电压 R u 1V"}, - {"key": "0x1080", "datatype": "int32", "remark": "B相电压 R u 1V"}, - {"key": "0x1082", "datatype": "int32", "remark": "C相电压 R u 1V"}, - {"key": "0x1084", "datatype": "int32", "remark": "A相电流 R 1A"}, - {"key": "0x1086", "datatype": "int32", "remark": "B相电流 R 1A"}, - {"key": "0x1088", "datatype": "int32", "remark": "C相电流 R 1A"}, - {"key": "0x108A", "datatype": "int32", "remark": "AB相电压 R u 1V"}, - {"key": "0x108C", "datatype": "int32", "remark": "BC相电压 R u 1V"}, - {"key": "0x108E", "datatype": "int32", "remark": "CA相电压 R u 1V"}, - {"key": "0x1090", "datatype": "int32", "remark": "A相有功功率 R 1kW"}, - {"key": "0x1092", "datatype": "int32", "remark": "B相有功功率 R 1kW"}, - {"key": "0x1094", "datatype": "int32", "remark": "C相有功功率 R 1kW"}, - {"key": "0x1096", "datatype": "int32", "remark": "三相总有功功率 R 1kW"}, - {"key": "0x1098", "datatype": "int32", "remark": "当前控制功率 R 0.1kW 堆数据"}, - {"key": "0x109A", "datatype": "int32", "remark": "负荷率 R u 1% 台区控制策略数据 0不拿 大于0 默认拿第一个"}, - {"key": "0x109C", "datatype": "int32", "remark": "三相不平衡度  R u 1%"}, - {"key": "0x109E", "datatype": "int32", "remark": "功率因素比率  R u 1%"}, - {"key": "0x10A0", "datatype": "int32", "remark": "进线开关柜功率 R 1kW 并网口电表"}, - {"key": "0x10A2", "datatype": "int32", "remark": "用户关口表功率 R 1kW 并网口电表"}, - {"key": "0x10A4", "datatype": "", "remark": "预留"}, - {"key": "0x1104", "datatype": "int32", "remark": "预留正向总有功总需量 R 1kW"}, - {"key": "0x1106", "datatype": "int32", "remark": "尖段电价 R u 1RMB"}, - {"key": "0x1108", "datatype": "int32", "remark": "峰段电价 R u 1RMB"}, - {"key": "0x110A", "datatype": "int32", "remark": "平段电价 R u 1RMB"}, - {"key": "0x110C", "datatype": "int32", "remark": "谷段电价 R u 1RMB"}, - {"key": "0x110E", "datatype": "int32", "remark": "日充电电量 R u 1kWh"}, - {"key": "0x1110", "datatype": "int32", "remark": "日放电电量 R u 1kWh"}, - {"key": "0x1112", "datatype": "int32", "remark": "日充电费用 R u 1RMB"}, - {"key": "0x1114", "datatype": "int32", "remark": "日放电费用 R u 1RMB"}, - {"key": "0x1116", "datatype": "int32", "remark": "日收益 R 1RMB"}, - {"key": "0x1118", "datatype": "int32", "remark": "日正向尖有功电能 R u 1kWh"}, - {"key": "0x111A", "datatype": "int32", "remark": "日正向峰有功电能 R u 1kWh"}, - {"key": "0x111C", "datatype": "int32", "remark": "日正向平有功电能 R u 1kWh"}, - {"key": "0x111E", "datatype": "int32", "remark": "日正向谷有功电能 R u 1kWh"}, - {"key": "0x1120", "datatype": "int32", "remark": "日正向总有功电能 R u 1kWh"}, - {"key": "0x1122", "datatype": "int32", "remark": "日反向尖有功电能 R u 1kWh"}, - {"key": "0x1124", "datatype": "int32", "remark": "日反向峰有功电能 R u 1kWh"}, - {"key": "0x1126", "datatype": "int32", "remark": "日反向平有功电能 R u 1kWh"}, - {"key": "0x1128", "datatype": "int32", "remark": "日反向谷有功电能 R u 1kWh"}, - {"key": "0x112A", "datatype": "int32", "remark": "日反向总有功电能 R u 1kWh"}, - {"key": "0x112C", "datatype": "int32", "remark": "总充电电量 R u 1kWh"}, - {"key": "0x112E", "datatype": "int32", "remark": "总放电电量 R u 1kWh"}, - {"key": "0x1130", "datatype": "int32", "remark": "总充电费用 R u 1RMB"}, - {"key": "0x1132", "datatype": "int32", "remark": "总放电费用 R u 1RMB"}, - {"key": "0x1134", "datatype": "int32", "remark": "总收益 R 1RMB"}, - {"key": "0x1136", "datatype": "int32", "remark": "总正向尖有功电能 R u 1kWh"}, - {"key": "0x1138", "datatype": "int32", "remark": "总正向峰有功电能 R u 1kWh"}, - {"key": "0x113A", "datatype": "int32", "remark": "总正向平有功电能 R u 1kWh"}, - {"key": "0x113C", "datatype": "int32", "remark": "总正向谷有功电能 R u 1kWh"}, - {"key": "0x113E", "datatype": "int32", "remark": "总正向总有功电能 R u 1kWh"}, - {"key": "0x1140", "datatype": "int32", "remark": "总反向尖有功电能 R u 1kWh"}, - {"key": "0x1142", "datatype": "int32", "remark": "总反向峰有功电能 R u 1kWh"}, - {"key": "0x1144", "datatype": "int32", "remark": "总反向平有功电能 R u 1kWh"}, - {"key": "0x1146", "datatype": "int32", "remark": "总反向谷有功电能 R u 1kWh"}, - {"key": "0x1148", "datatype": "int32", "remark": "总反向总有功电能 R u 1kWh"}, - {"key": "0x114A", "datatype": "", "remark": "预留"}, - {"key": "0x11AE", "datatype": "int16", "remark": "预留预留交流A相电压 R 1V"}, - {"key": "0x11AF", "datatype": "int16", "remark": "交流B相电压 R 1V"}, - {"key": "0x11B0", "datatype": "int16", "remark": "交流C相电压 R 1V"}, - {"key": "0x11B1", "datatype": "int16", "remark": "交流A相频率 R 1Hz"}, - {"key": "0x11B2", "datatype": "int16", "remark": "交流B相频率 R 1Hz"}, - {"key": "0x11B3", "datatype": "int16", "remark": "交流C相频率 R 1Hz"}, - {"key": "0x11B4", "datatype": "int32", "remark": "总直流功率 R 1kW"}, - {"key": "0x11B6", "datatype": "int32", "remark": "总直流电压 R u 0.1V"}, - {"key": "0x11B8", "datatype": "int32", "remark": "总直流电流 R 0.1A"}, - {"key": "0x11B9", "datatype": "", "remark": "预留"}, - {"key": "0x121B", "datatype": "int16", "remark": "预留预留储能系统温度 R 0.1℃ 堆里面单体温度最高"}, - {"key": "0x121C", "datatype": "int16", "remark": "储能充放电时段hh R u 时 0x01"}, - {"key": "0x121D", "datatype": "int16", "remark": "储能充放电时段mm R u 分 0x01"}, - {"key": "0x121E", "datatype": "int16", "remark": "储能充放电时段ss R u 秒 0x01"}, - {"key": "0x121F", "datatype": "int16", "remark": "储能系统各时段功率 R 1kW 0x01"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属主控号1~4"}, + {"key": "0x0002", "datatype": "uint16", "remark": "所属PCS号1~40"}, + {"key": "0x0003", "datatype": "uint32", "remark": "总充电量(1kWh)"}, + {"key": "0x0005", "datatype": "uint32", "remark": "总放电量(1kWh)"}, + {"key": "0x0007", "datatype": "int16", "remark": "散热器温度(1℃)"}, + {"key": "0x0008", "datatype": "int16", "remark": "内部温度(1℃)"}, + {"key": "0x0009", "datatype": "int16", "remark": "最大允许充电功率(0.1kW)"}, + {"key": "0x000A", "datatype": "int16", "remark": "最大允许放电功率(0.1kW)"}, + {"key": "0x000B", "datatype": "int16", "remark": "有功功率期望(1kWh)"}, + {"key": "0x000C", "datatype": "int16", "remark": "无功功率期望(1kVar)"}, + {"key": "0x000D", "datatype": "int16", "remark": "AB线电压(1V)"}, + {"key": "0x000E", "datatype": "int16", "remark": "BC线电压(1V)"}, + {"key": "0x000F", "datatype": "int16", "remark": "CA线电压(1V)"}, + {"key": "0x0010", "datatype": "int16", "remark": "A相电压(1V)"}, + {"key": "0x0011", "datatype": "int16", "remark": "B相电压(1V)"}, + {"key": "0x0012", "datatype": "int16", "remark": "C相电压(1V)"}, + {"key": "0x0013", "datatype": "int16", "remark": "A相频率(1Hz)"}, + {"key": "0x0014", "datatype": "int16", "remark": "B相频率(1Hz)"}, + {"key": "0x0015", "datatype": "int16", "remark": "C相频率(1Hz)"}, + {"key": "0x0016", "datatype": "int16", "remark": "A相功率因数(1)"}, + {"key": "0x0017", "datatype": "int16", "remark": "B相功率因数(1)"}, + {"key": "0x0018", "datatype": "int16", "remark": "C相功率因数(1)"}, + {"key": "0x0019", "datatype": "int16", "remark": "A相电流(1A)"}, + {"key": "0x001A", "datatype": "int16", "remark": "B相电流(1A)"}, + {"key": "0x001B", "datatype": "int16", "remark": "C相电流(1A)"}, + {"key": "0x001C", "datatype": "int16", "remark": "A相有功功率(1kW)"}, + {"key": "0x001D", "datatype": "int16", "remark": "B相有功功率(1kW)"}, + {"key": "0x001E", "datatype": "int16", "remark": "C相有功功率(1kW)"}, + {"key": "0x001F", "datatype": "int16", "remark": "A相无功功率(1kVar)"}, + {"key": "0x0020", "datatype": "int16", "remark": "B相无功功率(1kVar)"}, + {"key": "0x0021", "datatype": "int16", "remark": "C相无功功率(1kVar)"}, + {"key": "0x0022", "datatype": "int16", "remark": "A相视在功率(1kVA)"}, + {"key": "0x0023", "datatype": "int16", "remark": "B相视在功率(1kVA)"}, + {"key": "0x0024", "datatype": "int16", "remark": "C相视在功率(1kVA)"}, + {"key": "0x0025", "datatype": "int16", "remark": "三相总有功功率(1kW)"}, + {"key": "0x0026", "datatype": "int16", "remark": "三相总无功功率(1kVar)"}, + {"key": "0x0027", "datatype": "int16", "remark": "三相总视在功率(1kVA)"}, + {"key": "0x0028", "datatype": "int16", "remark": "三相总功率因数(1)"}, + {"key": "0x0029", "datatype": "int16", "remark": "直流功率(1kW)"}, + {"key": "0x002A", "datatype": "int16", "remark": "直流电压(1V)"}, + {"key": "0x002B", "datatype": "int16", "remark": "直流电流(1A)"}, + {"key": "0x002C", "datatype": "int16", "remark": "充电功率(1kW)"}, + {"key": "0x002D", "datatype": "int16", "remark": "放电功率(1kW)"}, + {"key": "0x002E", "datatype": "int16", "remark": "PF值(1)"}, + {"key": "0x002F", "datatype": "int16", "remark": "UV线/U相电网计量线电压(1V)"}, + {"key": "0x0030", "datatype": "int16", "remark": "VW线/V相电网计量线电压(1V)"}, + {"key": "0x0031", "datatype": "int16", "remark": "WU线/W相电网计量线电压(1V)"}, + {"key": "0x0032", "datatype": "int16", "remark": "U相电网计量电流(1A)"}, + {"key": "0x0033", "datatype": "int16", "remark": "V相电网计量电流(1A)"}, + {"key": "0x0034", "datatype": "int16", "remark": "W相电网计量电流(1A)"}, + {"key": "0x0035", "datatype": "int16", "remark": "正母线电压(1V)"}, + {"key": "0x0036", "datatype": "int16", "remark": "可用功率(1kVA)"}, + {"key": "0x0037", "datatype": "int16", "remark": "负母线电压(1V)"}, + {"key": "0x0038", "datatype": "int16", "remark": "A相IGBT温度(1℃)"}, + {"key": "0x0039", "datatype": "int16", "remark": "B相IGBT温度(1℃)"}, + {"key": "0x003A", "datatype": "int16", "remark": "C相IGBT温度(1℃)"}, + {"key": "0x003B", "datatype": "int16", "remark": "逆变侧AB线电压(1V)"}, + {"key": "0x003C", "datatype": "int16", "remark": "逆变侧BC线电压(1V)"}, + {"key": "0x003D", "datatype": "int16", "remark": "逆变侧CA线电压(1V)"}, + {"key": "0x003E", "datatype": "int16", "remark": "逆变侧A相电压(1V)"}, + {"key": "0x003F", "datatype": "int16", "remark": "逆变侧B相电压(1V)"}, + {"key": "0x0040", "datatype": "int16", "remark": "逆变侧C相电压(1V)"}, + {"key": "0x0041", "datatype": "int16", "remark": "逆变侧A相电流(1A)"}, + {"key": "0x0042", "datatype": "int16", "remark": "逆变侧B相电流(1A)"}, + {"key": "0x0043", "datatype": "int16", "remark": "逆变侧C相电流(1A)"}, + {"key": "0x0044", "datatype": "int16", "remark": "逆变侧A相电流直流分量(1A)"}, + {"key": "0x0045", "datatype": "int16", "remark": "逆变侧B相电流直流分量(1A)"}, + {"key": "0x0046", "datatype": "int16", "remark": "逆变侧C相电流直流分量(1A)"}, + {"key": "0x0047", "datatype": "int16", "remark": "离网频率(1Hz)"}, + {"key": "0x0048", "datatype": "int16", "remark": "A相负载量(1)"}, + {"key": "0x0049", "datatype": "int16", "remark": "B相负载量(1)"}, + {"key": "0x004A", "datatype": "int16", "remark": "C相负载量(1)"}, + {"key": "0x004B", "datatype": "int16", "remark": "总负载量(1)"}, + {"key": "0x004C", "datatype": "int16", "remark": "逆变侧AB线电压直流分量(1A)"}, + {"key": "0x004D", "datatype": "int16", "remark": "逆变侧BC线电压直流分量(1A)"}, + {"key": "0x004E", "datatype": "int16", "remark": "逆变侧CA线电压直流分量(1A)"}, + {"key": "0x004F", "datatype": "int16", "remark": "在线数量"} ] }, - "PCS_YX": { - "count":1, + "PCS_YX":{ "addr":[ - {"key": "0x1001", "datatype": "int16", "remark": "所属主控号 R u 1~4"}, - {"key": "0x1002", "datatype": "int16", "remark": "所属PCS号 R u 1~40"}, - {"key": "0x1003", "datatype": "int16", "remark": "故障状态 R u 1故障,0正常"}, - {"key": "0x1004", "datatype": "int16", "remark": "告警状态 R u 1告警,0正常"}, - {"key": "0x1005", "datatype": "int16", "remark": "设备在线 R u 1在线,0无效"}, - {"key": "0x1006", "datatype": "int16", "remark": "禁止充电 R u 1禁止,0无效"}, - {"key": "0x1007", "datatype": "int16", "remark": "禁止放电 R u 1禁止,0无效"}, - {"key": "0x1008", "datatype": "int16", "remark": "运行状态 R u 1开机,0关机"}, - {"key": "0x1009", "datatype": "int16", "remark": "充放状态 R u 0:待机,1:充电,2:放电,3:搁置"}, - {"key": "0x100A", "datatype": "int16", "remark": "电网状态 R u 1离网,0并网"}, - {"key": "0x100B", "datatype": "int16", "remark": "逆变供电 R u 0禁止,1使能"}, - {"key": "0x100C", "datatype": "int16", "remark": "缓启动完成 R u 0禁止,1使能"}, - {"key": "0x100D", "datatype": "int16", "remark": "主机标志 R u 0禁止,1使能"}, - {"key": "0x100E", "datatype": "int16", "remark": "并离网状态 R u 0:并网, 1:离网"}, - {"key": "0x100F", "datatype": "int16", "remark": "同步请求标志 R u 0:无效;1:动作"}, - {"key": "0x1010", "datatype": "int16", "remark": "绝缘故障 R u 1:故障,0正常"}, - {"key": "0x1011", "datatype": "int16", "remark": "漏电保护 R u 1:故障,0正常"}, - {"key": "0x1012", "datatype": "int16", "remark": "直流过压 R u 1:故障,0正常"}, - {"key": "0x1013", "datatype": "int16", "remark": "市电幅值异常 R u 1:故障,0正常"}, - {"key": "0x1014", "datatype": "int16", "remark": "市电相序异常 R u 1:故障,0正常"}, - {"key": "0x1015", "datatype": "int16", "remark": "温度开关异常 R u 1:故障,0正常"}, - {"key": "0x1016", "datatype": "int16", "remark": "市电频率异常 R u 1:故障,0正常"}, - {"key": "0x1017", "datatype": "int16", "remark": "IGBT过温 R u 1:故障,0正常"}, - {"key": "0x1018", "datatype": "int16", "remark": "交流接地故障 R u 1:故障,0正常"}, - {"key": "0x1019", "datatype": "int16", "remark": "逆变过流异常 R u 1:故障,0正常"}, - {"key": "0x101A", "datatype": "int16", "remark": "直流缓起故障 R u 1:故障,0正常"}, - {"key": "0x101B", "datatype": "int16", "remark": "直流主继电器故障 R u 1:故障,0正常"}, - {"key": "0x101C", "datatype": "int16", "remark": "风机异常 R u 1:故障,0正常"}, - {"key": "0x101D", "datatype": "int16", "remark": "主接触器异常 R u 1:故障,0正常"}, - {"key": "0x101E", "datatype": "int16", "remark": "均浮充切换超时 R u 1:故障,0正常"}, - {"key": "0x101F", "datatype": "int16", "remark": "硬件故障 R u 1:故障,0正常"}, - {"key": "0x1020", "datatype": "int16", "remark": "机内过温 R u 1:故障,0正常"}, - {"key": "0x1021", "datatype": "int16", "remark": "软启动故障 R u 1:故障,0正常"}, - {"key": "0x1022", "datatype": "int16", "remark": "触摸屏通讯故障 R u 1:故障,0正常"}, - {"key": "0x1023", "datatype": "int16", "remark": "防雷器故障 R u 1:故障,0正常"}, - {"key": "0x1024", "datatype": "int16", "remark": "急停故障 R u 1:故障,0正常"}, - {"key": "0x1025", "datatype": "int16", "remark": "BMS系统故障 R u 1:故障,0正常"}, - {"key": "0x1026", "datatype": "int16", "remark": "BMS通讯故障 R u 1:故障,0正常"}, - {"key": "0x1027", "datatype": "int16", "remark": "BMS干接点通讯故障 R u 1:故障,0正常"}, - {"key": "0x1028", "datatype": "int16", "remark": "远程通讯故障 R u 1:故障,0正常"}, - {"key": "0x1029", "datatype": "int16", "remark": "门禁告警 R u 1:故障,0正常"}, - {"key": "0x102A", "datatype": "int16", "remark": "锁相异常 R u 1:故障,0正常"}, - {"key": "0x102B", "datatype": "int16", "remark": "IGBT过温告警 R u 1:故障,0正常"}, - {"key": "0x102C", "datatype": "int16", "remark": "硬件过流保护 R u 1:故障,0正常"}, - {"key": "0x102D", "datatype": "int16", "remark": "驱动故障 R u 1:故障,0正常"}, - {"key": "0x102E", "datatype": "int16", "remark": "ID冲突 R u 1:故障,0正常"}, - {"key": "0x102F", "datatype": "int16", "remark": "电池过压 R u 1:故障,0正常"}, - {"key": "0x1030", "datatype": "int16", "remark": "电池欠压 R u 1:故障,0正常"}, - {"key": "0x1031", "datatype": "int16", "remark": "直流过流保护 R u 1:故障,0正常"}, - {"key": "0x1032", "datatype": "int16", "remark": "输出电压异常 R u 1:故障,0正常"}, - {"key": "0x1033", "datatype": "int16", "remark": "离网输出电压不符合 R u 1:故障,0正常"}, - {"key": "0x1034", "datatype": "int16", "remark": "输出过载保护 R u 1:故障,0正常"}, - {"key": "0x1035", "datatype": "int16", "remark": "输出短路保护 R u 1:故障,0正常"}, - {"key": "0x1036", "datatype": "int16", "remark": "并机通信异常 R u 1:故障,0正常"}, - {"key": "0x1037", "datatype": "int16", "remark": "电池保险异常 R u 1:故障,0正常"}, - {"key": "0x1038", "datatype": "int16", "remark": "电池重载低压 R u 1:故障,0正常"}, - {"key": "0x1039", "datatype": "int16", "remark": "电池低压告警 R u 1:故障,0正常"}, - {"key": "0x103A", "datatype": "int16", "remark": "一拖二压差过大 R u 1:故障,0正常"}, - {"key": "0x103B", "datatype": "int16", "remark": "电池反接故障 R u 1:故障,0正常"}, - {"key": "0x103C", "datatype": "int16", "remark": "电池电压异常 R u 1:故障,0正常"}, - {"key": "0x103D", "datatype": "int16", "remark": "过载告警 R u 1:故障,0正常"}, - {"key": "0x103E", "datatype": "int16", "remark": "外部接触器异常 R u 1:故障,0正常"}, - {"key": "0x103F", "datatype": "int16", "remark": "IGBT温度传感器异常 R u 1:故障,0正常"}, - {"key": "0x1040", "datatype": "int16", "remark": "整机温度传感器异常 R u 1:故障,0正常"}, - {"key": "0x1041", "datatype": "int16", "remark": "市电CT异常 R u 1:故障,0正常"}, - {"key": "0x1042", "datatype": "int16", "remark": "逆变电流三相不平衡 R u 1:故障,0正常"}, - {"key": "0x1043", "datatype": "int16", "remark": "逆变电流直流分量异常 R u 1:故障,0正常"}, - {"key": "0x1044", "datatype": "int16", "remark": "母线不平衡 R u 1:故障,0正常"}, - {"key": "0x1045", "datatype": "int16", "remark": "逆变电压直流分量异常 R u 1:故障,0正常"}, - {"key": "0x1046", "datatype": "int16", "remark": "主接触器控制异常 R u 1:故障,0正常"}, - {"key": "0x1047", "datatype": "int16", "remark": "逆变电压控制异常 R u 1:故障,0正常"}, - {"key": "0x1048", "datatype": "int16", "remark": "直流霍尔异常 R u 1:故障,0正常"}, - {"key": "0x1049", "datatype": "int16", "remark": "电池单体过压 R u 1:故障,0正常"}, - {"key": "0x104A", "datatype": "int16", "remark": "电池单体欠压 R u 1:故障,0正常"}, - {"key": "0x104B", "datatype": "int16", "remark": "电网过压 R u 1:故障,0正常"}, - {"key": "0x104C", "datatype": "int16", "remark": "电网欠压 R u 1:故障,0正常"}, - {"key": "0x104D", "datatype": "int16", "remark": "电网过频 R u 1:故障,0正常"}, - {"key": "0x104E", "datatype": "int16", "remark": "电网欠频 R u 1:故障,0正常"}, - {"key": "0x104F", "datatype": "int16", "remark": "市电不平衡 R u 1:故障,0正常"}, - {"key": "0x1050", "datatype": "int16", "remark": "参数设置不匹配 R u 1:故障,0正常"}, - {"key": "0x1051", "datatype": "int16", "remark": "SPI通信异常 R u 1:故障,0正常"}, - {"key": "0x1052", "datatype": "int16", "remark": "SCI通信异常 R u 1:故障,0正常"}, - {"key": "0x1053", "datatype": "int16", "remark": "IIC通信异常 R u 1:故障,0正常"}, - {"key": "0x1054", "datatype": "int16", "remark": "Xintf通信异常 R u 1:故障,0正常"}, - {"key": "0x1055", "datatype": "int16", "remark": "零偏校准异常 R u 1:故障,0正常"}, - {"key": "0x1056", "datatype": "int16", "remark": "烟雾告警 R u 1:故障,0正常"}, - {"key": "0x1057", "datatype": "int16", "remark": "无电池组故障 R u 1异常,0正常"}, - {"key": "0x1058", "datatype": "int16", "remark": "环温降频 R u 1异常,0正常"}, - {"key": "0x1059", "datatype": "int16", "remark": "交流过载 R u 1异常,0正常"}, - {"key": "0x105A", "datatype": "int16", "remark": "采样异常 R u 1异常,0正常"}, - {"key": "0x105B", "datatype": "int16", "remark": "24V辅源故障 R u 1异常,0正常"}, - {"key": "0x105C", "datatype": "int16", "remark": "直流欠压异常 R u 1异常,0正常"}, - {"key": "0x105D", "datatype": "int16", "remark": "散热器过温 R u 1异常,0正常"}, - {"key": "0x105E", "datatype": "int16", "remark": "CAN配置故障 R u 1异常,0正常"}, - {"key": "0x105F", "datatype": "int16", "remark": "3.3V辅源故障 R u 1异常,0正常"}, - {"key": "0x1060", "datatype": "int16", "remark": "环境过温 R u 1异常,0正常"}, - {"key": "0x1061", "datatype": "int16", "remark": "A相IGBT逆变过流 R u 1异常,0正常"}, - {"key": "0x1062", "datatype": "int16", "remark": "B相IGBT逆变过流 R u 1异常,0正常"}, - {"key": "0x1063", "datatype": "int16", "remark": "C相IGBT逆变过流 R u 1异常,0正常"} + {"key": "0x1001", "datatype": "uint16", "remark": "所属主控号1~4"}, + {"key": "0x1002", "datatype": "uint16", "remark": "所属PCS号1~40"}, + {"key": "0x1003", "datatype": "uint16", "remark": "故障状态1故障,0正常"}, + {"key": "0x1004", "datatype": "uint16", "remark": "告警状态1告警,0正常"}, + {"key": "0x1005", "datatype": "uint16", "remark": "设备在线1在线,0无效"}, + {"key": "0x1006", "datatype": "uint16", "remark": "禁止充电1禁止,0无效"}, + {"key": "0x1007", "datatype": "uint16", "remark": "禁止放电1禁止,0无效"}, + {"key": "0x1008", "datatype": "uint16", "remark": "运行状态1开机,0关机"}, + {"key": "0x1009", "datatype": "uint16", "remark": "充放状态0:待机,1:充电,2:放电,3:搁置"}, + {"key": "0x100A", "datatype": "uint16", "remark": "电网状态1离网,0并网"}, + {"key": "0x100B", "datatype": "uint16", "remark": "逆变供电0禁止,1使能"}, + {"key": "0x100C", "datatype": "uint16", "remark": "缓启动完成0禁止,1使能"}, + {"key": "0x100D", "datatype": "uint16", "remark": "主机标志0禁止,1使能"}, + {"key": "0x100E", "datatype": "uint16", "remark": "并离网状态0:并网, 1:离网"}, + {"key": "0x100F", "datatype": "uint16", "remark": "同步请求标志0:无效;1:动作"}, + {"key": "0x1010", "datatype": "uint16", "remark": "绝缘故障1:故障,0正常"}, + {"key": "0x1011", "datatype": "uint16", "remark": "漏电保护1:故障,0正常"}, + {"key": "0x1012", "datatype": "uint16", "remark": "直流过压1:故障,0正常"}, + {"key": "0x1013", "datatype": "uint16", "remark": "市电幅值异常1:故障,0正常"}, + {"key": "0x1014", "datatype": "uint16", "remark": "市电相序异常1:故障,0正常"}, + {"key": "0x1015", "datatype": "uint16", "remark": "温度开关异常1:故障,0正常"}, + {"key": "0x1016", "datatype": "uint16", "remark": "市电频率异常1:故障,0正常"}, + {"key": "0x1017", "datatype": "uint16", "remark": "IGBT过温1:故障,0正常"}, + {"key": "0x1018", "datatype": "uint16", "remark": "交流接地故障1:故障,0正常"}, + {"key": "0x1019", "datatype": "uint16", "remark": "逆变过流异常1:故障,0正常"}, + {"key": "0x101A", "datatype": "uint16", "remark": "直流缓起故障1:故障,0正常"}, + {"key": "0x101B", "datatype": "uint16", "remark": "直流主继电器故障1:故障,0正常"}, + {"key": "0x101C", "datatype": "uint16", "remark": "风机异常1:故障,0正常"}, + {"key": "0x101D", "datatype": "uint16", "remark": "主接触器异常1:故障,0正常"}, + {"key": "0x101E", "datatype": "uint16", "remark": "均浮充切换超时1:故障,0正常"}, + {"key": "0x101F", "datatype": "uint16", "remark": "硬件故障1:故障,0正常"}, + {"key": "0x1020", "datatype": "uint16", "remark": "机内过温1:故障,0正常"}, + {"key": "0x1021", "datatype": "uint16", "remark": "软启动故障1:故障,0正常"}, + {"key": "0x1022", "datatype": "uint16", "remark": "触摸屏通讯故障1:故障,0正常"}, + {"key": "0x1023", "datatype": "uint16", "remark": "防雷器故障1:故障,0正常"}, + {"key": "0x1024", "datatype": "uint16", "remark": "急停故障1:故障,0正常"}, + {"key": "0x1025", "datatype": "uint16", "remark": "BMS系统故障1:故障,0正常"}, + {"key": "0x1026", "datatype": "uint16", "remark": "BMS通讯故障1:故障,0正常"}, + {"key": "0x1027", "datatype": "uint16", "remark": "BMS干接点通讯故障1:故障,0正常"}, + {"key": "0x1028", "datatype": "uint16", "remark": "远程通讯故障1:故障,0正常"}, + {"key": "0x1029", "datatype": "uint16", "remark": "门禁告警1:故障,0正常"}, + {"key": "0x102A", "datatype": "uint16", "remark": "锁相异常1:故障,0正常"}, + {"key": "0x102B", "datatype": "uint16", "remark": "IGBT过温告警1:故障,0正常"}, + {"key": "0x102C", "datatype": "uint16", "remark": "硬件过流保护1:故障,0正常"}, + {"key": "0x102D", "datatype": "uint16", "remark": "驱动故障1:故障,0正常"}, + {"key": "0x102E", "datatype": "uint16", "remark": "ID冲突1:故障,0正常"}, + {"key": "0x102F", "datatype": "uint16", "remark": "电池过压1:故障,0正常"}, + {"key": "0x1030", "datatype": "uint16", "remark": "电池欠压1:故障,0正常"}, + {"key": "0x1031", "datatype": "uint16", "remark": "直流过流保护1:故障,0正常"}, + {"key": "0x1032", "datatype": "uint16", "remark": "输出电压异常1:故障,0正常"}, + {"key": "0x1033", "datatype": "uint16", "remark": "离网输出电压不符合1:故障,0正常"}, + {"key": "0x1034", "datatype": "uint16", "remark": "输出过载保护1:故障,0正常"}, + {"key": "0x1035", "datatype": "uint16", "remark": "输出短路保护1:故障,0正常"}, + {"key": "0x1036", "datatype": "uint16", "remark": "并机通信异常1:故障,0正常"}, + {"key": "0x1037", "datatype": "uint16", "remark": "电池保险异常1:故障,0正常"}, + {"key": "0x1038", "datatype": "uint16", "remark": "电池重载低压1:故障,0正常"}, + {"key": "0x1039", "datatype": "uint16", "remark": "电池低压告警1:故障,0正常"}, + {"key": "0x103A", "datatype": "uint16", "remark": "一拖二压差过大1:故障,0正常"}, + {"key": "0x103B", "datatype": "uint16", "remark": "电池反接故障1:故障,0正常"}, + {"key": "0x103C", "datatype": "uint16", "remark": "电池电压异常1:故障,0正常"}, + {"key": "0x103D", "datatype": "uint16", "remark": "过载告警1:故障,0正常"}, + {"key": "0x103E", "datatype": "uint16", "remark": "外部接触器异常1:故障,0正常"}, + {"key": "0x103F", "datatype": "uint16", "remark": "IGBT温度传感器异常1:故障,0正常"}, + {"key": "0x1040", "datatype": "uint16", "remark": "整机温度传感器异常1:故障,0正常"}, + {"key": "0x1041", "datatype": "uint16", "remark": "市电CT异常1:故障,0正常"}, + {"key": "0x1042", "datatype": "uint16", "remark": "逆变电流三相不平衡1:故障,0正常"}, + {"key": "0x1043", "datatype": "uint16", "remark": "逆变电流直流分量异常1:故障,0正常"}, + {"key": "0x1044", "datatype": "uint16", "remark": "母线不平衡1:故障,0正常"}, + {"key": "0x1045", "datatype": "uint16", "remark": "逆变电压直流分量异常1:故障,0正常"}, + {"key": "0x1046", "datatype": "uint16", "remark": "主接触器控制异常1:故障,0正常"}, + {"key": "0x1047", "datatype": "uint16", "remark": "逆变电压控制异常1:故障,0正常"}, + {"key": "0x1048", "datatype": "uint16", "remark": "直流霍尔异常1:故障,0正常"}, + {"key": "0x1049", "datatype": "uint16", "remark": "电池单体过压1:故障,0正常"}, + {"key": "0x104A", "datatype": "uint16", "remark": "电池单体欠压1:故障,0正常"}, + {"key": "0x104B", "datatype": "uint16", "remark": "电网过压1:故障,0正常"}, + {"key": "0x104C", "datatype": "uint16", "remark": "电网欠压1:故障,0正常"}, + {"key": "0x104D", "datatype": "uint16", "remark": "电网过频1:故障,0正常"}, + {"key": "0x104E", "datatype": "uint16", "remark": "电网欠频1:故障,0正常"}, + {"key": "0x104F", "datatype": "uint16", "remark": "市电不平衡1:故障,0正常"}, + {"key": "0x1050", "datatype": "uint16", "remark": "参数设置不匹配1:故障,0正常"}, + {"key": "0x1051", "datatype": "uint16", "remark": "SPI通信异常1:故障,0正常"}, + {"key": "0x1052", "datatype": "uint16", "remark": "SCI通信异常1:故障,0正常"}, + {"key": "0x1053", "datatype": "uint16", "remark": "IIC通信异常1:故障,0正常"}, + {"key": "0x1054", "datatype": "uint16", "remark": "Xintf通信异常1:故障,0正常"}, + {"key": "0x1055", "datatype": "uint16", "remark": "零偏校准异常1:故障,0正常"}, + {"key": "0x1056", "datatype": "uint16", "remark": "烟雾告警1:故障,0正常"}, + {"key": "0x1057", "datatype": "uint16", "remark": "无电池组故障1异常,0正常"}, + {"key": "0x1058", "datatype": "uint16", "remark": "环温降频1异常,0正常"}, + {"key": "0x1059", "datatype": "uint16", "remark": "交流过载1异常,0正常"}, + {"key": "0x105A", "datatype": "uint16", "remark": "采样异常1异常,0正常"}, + {"key": "0x105B", "datatype": "uint16", "remark": "24V辅源故障1异常,0正常"}, + {"key": "0x105C", "datatype": "uint16", "remark": "直流欠压异常1异常,0正常"}, + {"key": "0x105D", "datatype": "uint16", "remark": "散热器过温1异常,0正常"}, + {"key": "0x105E", "datatype": "uint16", "remark": "CAN配置故障1异常,0正常"}, + {"key": "0x105F", "datatype": "uint16", "remark": "3.3V辅源故障1异常,0正常"}, + {"key": "0x1060", "datatype": "uint16", "remark": "环境过温1异常,0正常"}, + {"key": "0x1061", "datatype": "uint16", "remark": "A相IGBT逆变过流1异常,0正常"}, + {"key": "0x1062", "datatype": "uint16", "remark": "B相IGBT逆变过流1异常,0正常"} ] }, - "PCS_YC": { - "count":1, + "BMS_YC":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属主控号 R u 1~4"}, - {"key": "0x0002", "datatype": "int16", "remark": "所属PCS号 R u 1~40"}, - {"key": "0x0003", "datatype": "int32", "remark": "总充电量 R u 1kWh"}, - {"key": "0x0005", "datatype": "int32", "remark": "总放电量 R u 1kWh"}, - {"key": "0x0007", "datatype": "int16", "remark": "散热器温度 R 1℃"}, - {"key": "0x0008", "datatype": "int16", "remark": "内部温度 R 1℃"}, - {"key": "0x0009", "datatype": "int16", "remark": "最大允许充电功率 R 0.1kW"}, - {"key": "0x000A", "datatype": "int16", "remark": "最大允许放电功率 R 0.1kW"}, - {"key": "0x000B", "datatype": "int16", "remark": "有功功率期望 R 1kWh"}, - {"key": "0x000C", "datatype": "int16", "remark": "无功功率期望 R 1kVar"}, - {"key": "0x000D", "datatype": "int16", "remark": "AB线电压 R 1V"}, - {"key": "0x000E", "datatype": "int16", "remark": "BC线电压 R 1V"}, - {"key": "0x000F", "datatype": "int16", "remark": "CA线电压 R 1V"}, - {"key": "0x0010", "datatype": "int16", "remark": "A相电压 R 1V"}, - {"key": "0x0011", "datatype": "int16", "remark": "B相电压 R 1V"}, - {"key": "0x0012", "datatype": "int16", "remark": "C相电压 R 1V"}, - {"key": "0x0013", "datatype": "int16", "remark": "A相频率 R 1Hz"}, - {"key": "0x0014", "datatype": "int16", "remark": "B相频率 R 1Hz"}, - {"key": "0x0015", "datatype": "int16", "remark": "C相频率 R 1Hz"}, - {"key": "0x0016", "datatype": "int16", "remark": "A相功率因数 R 1"}, - {"key": "0x0017", "datatype": "int16", "remark": "B相功率因数 R 1"}, - {"key": "0x0018", "datatype": "int16", "remark": "C相功率因数 R 1"}, - {"key": "0x0019", "datatype": "int16", "remark": "A相电流 R 1A"}, - {"key": "0x001A", "datatype": "int16", "remark": "B相电流 R 1A"}, - {"key": "0x001B", "datatype": "int16", "remark": "C相电流 R 1A"}, - {"key": "0x001C", "datatype": "int16", "remark": "A相有功功率 R 1kW"}, - {"key": "0x001D", "datatype": "int16", "remark": "B相有功功率 R 1kW"}, - {"key": "0x001E", "datatype": "int16", "remark": "C相有功功率 R 1kW"}, - {"key": "0x001F", "datatype": "int16", "remark": "A相无功功率 R 1kVar"}, - {"key": "0x0020", "datatype": "int16", "remark": "B相无功功率 R 1kVar"}, - {"key": "0x0021", "datatype": "int16", "remark": "C相无功功率 R 1kVar"}, - {"key": "0x0022", "datatype": "int16", "remark": "A相视在功率 R 1kVA"}, - {"key": "0x0023", "datatype": "int16", "remark": "B相视在功率 R 1kVA"}, - {"key": "0x0024", "datatype": "int16", "remark": "C相视在功率 R 1kVA"}, - {"key": "0x0025", "datatype": "int16", "remark": "三相总有功功率 R 1kW"}, - {"key": "0x0026", "datatype": "int16", "remark": "三相总无功功率 R 1kVar"}, - {"key": "0x0027", "datatype": "int16", "remark": "三相总视在功率 R 1kVA"}, - {"key": "0x0028", "datatype": "int16", "remark": "三相总功率因数 R 1"}, - {"key": "0x0029", "datatype": "int16", "remark": "直流功率 R 1kW"}, - {"key": "0x002A", "datatype": "int16", "remark": "直流电压 R 1V"}, - {"key": "0x002B", "datatype": "int16", "remark": "直流电流 R 1A"}, - {"key": "0x002C", "datatype": "int16", "remark": "充电功率 R 1kW"}, - {"key": "0x002D", "datatype": "int16", "remark": "放电功率 R 1kW"}, - {"key": "0x002E", "datatype": "int16", "remark": "PF值 R 1"}, - {"key": "0x002F", "datatype": "int16", "remark": "UV线/U相电网计量线电压 R 1V"}, - {"key": "0x0030", "datatype": "int16", "remark": "VW线/V相电网计量线电压 R 1V"}, - {"key": "0x0031", "datatype": "int16", "remark": "WU线/W相电网计量线电压 R 1V"}, - {"key": "0x0032", "datatype": "int16", "remark": "U相电网计量电流 R 1A"}, - {"key": "0x0033", "datatype": "int16", "remark": "V相电网计量电流 R 1A"}, - {"key": "0x0034", "datatype": "int16", "remark": "W相电网计量电流 R 1A"}, - {"key": "0x0035", "datatype": "int16", "remark": "正母线电压 R 1V"}, - {"key": "0x0036", "datatype": "int16", "remark": "可用功率 R 1kVA"}, - {"key": "0x0037", "datatype": "int16", "remark": "负母线电压 R 1V"}, - {"key": "0x0038", "datatype": "int16", "remark": "A相IGBT温度 R 1℃"}, - {"key": "0x0039", "datatype": "int16", "remark": "B相IGBT温度 R 1℃"}, - {"key": "0x003A", "datatype": "int16", "remark": "C相IGBT温度 R 1℃"}, - {"key": "0x003B", "datatype": "int16", "remark": "逆变侧AB线电压 R 1V"}, - {"key": "0x003C", "datatype": "int16", "remark": "逆变侧BC线电压 R 1V"}, - {"key": "0x003D", "datatype": "int16", "remark": "逆变侧CA线电压 R 1V"}, - {"key": "0x003E", "datatype": "int16", "remark": "逆变侧A相电压 R 1V"}, - {"key": "0x003F", "datatype": "int16", "remark": "逆变侧B相电压 R 1V"}, - {"key": "0x0040", "datatype": "int16", "remark": "逆变侧C相电压 R 1V"}, - {"key": "0x0041", "datatype": "int16", "remark": "逆变侧A相电流 R 1A"}, - {"key": "0x0042", "datatype": "int16", "remark": "逆变侧B相电流 R 1A"}, - {"key": "0x0043", "datatype": "int16", "remark": "逆变侧C相电流 R 1A"}, - {"key": "0x0044", "datatype": "int16", "remark": "逆变侧A相电流直流分量 R 1A"}, - {"key": "0x0045", "datatype": "int16", "remark": "逆变侧B相电流直流分量 R 1A"}, - {"key": "0x0046", "datatype": "int16", "remark": "逆变侧C相电流直流分量 R 1A"}, - {"key": "0x0047", "datatype": "int16", "remark": "离网频率 R 1Hz"}, - {"key": "0x0048", "datatype": "int16", "remark": "A相负载量 R 1"}, - {"key": "0x0049", "datatype": "int16", "remark": "B相负载量 R 1"}, - {"key": "0x004A", "datatype": "int16", "remark": "C相负载量 R 1"}, - {"key": "0x004B", "datatype": "int16", "remark": "总负载量 R 1"}, - {"key": "0x004C", "datatype": "int16", "remark": "逆变侧AB线电压直流分量 R 1A"}, - {"key": "0x004D", "datatype": "int16", "remark": "逆变侧BC线电压直流分量 R 1A"}, - {"key": "0x004E", "datatype": "int16", "remark": "逆变侧CA线电压直流分量 R 1A"}, - {"key": "0x004F", "datatype": "int16", "remark": "在线数量 R "}, - {"key": "0x0050", "datatype": "int16", "remark": "逆变数量 R "} + {"key": "0x0001", "datatype": "uint16", "remark": "SOC(0.1)"}, + {"key": "0x0002", "datatype": "uint16", "remark": "SOH(0.1)"}, + {"key": "0x0003", "datatype": "uint32", "remark": "电压(0.1V)"}, + {"key": "0x0005", "datatype": "int32", "remark": "电流(0.1A)"}, + {"key": "0x0007", "datatype": "uint32", "remark": "可充电量(1kWh)"}, + {"key": "0x0009", "datatype": "uint32", "remark": "可放电量(1kWh)"}, + {"key": "0x000B", "datatype": "uint32", "remark": "单次可充电量(1kWh)"}, + {"key": "0x000D", "datatype": "uint32", "remark": "单次可放电量(1kWh)"}, + {"key": "0x000F", "datatype": "int32", "remark": "堆功率(1kW)"}, + {"key": "0x0011", "datatype": "uint32", "remark": "充电量累加(1kWh)"}, + {"key": "0x0013", "datatype": "uint32", "remark": "放电量累加(1kWh)"}, + {"key": "0x0015", "datatype": "uint16", "remark": "簇最大SOC(0.1)"}, + {"key": "0x0016", "datatype": "uint16", "remark": "簇最小SOC(0.1)"}, + {"key": "0x0017", "datatype": "uint16", "remark": "簇最大SOC号"}, + {"key": "0x0018", "datatype": "uint16", "remark": "簇最小SOC号"}, + {"key": "0x0019", "datatype": "uint16", "remark": "簇SOC差值(0.1)"}, + {"key": "0x001A", "datatype": "uint16", "remark": "簇最大电压(0.1V)"}, + {"key": "0x001B", "datatype": "uint16", "remark": "簇最小电压(0.1V)"}, + {"key": "0x001C", "datatype": "uint16", "remark": "簇最大电压号"}, + {"key": "0x001D", "datatype": "uint16", "remark": "簇最小电压号"}, + {"key": "0x001E", "datatype": "uint16", "remark": "簇电压差值(0.1V)"}, + {"key": "0x001F", "datatype": "uint16", "remark": "单体最大电压簇号"}, + {"key": "0x0020", "datatype": "uint16", "remark": "单体最大电压节号"}, + {"key": "0x0021", "datatype": "uint16", "remark": "单体最大电压(mV)"}, + {"key": "0x0022", "datatype": "uint16", "remark": "单体最小电压簇号"}, + {"key": "0x0023", "datatype": "uint16", "remark": "单体最小电压节号"}, + {"key": "0x0024", "datatype": "uint16", "remark": "单体最小电压(mV)"}, + {"key": "0x0025", "datatype": "uint16", "remark": "单体平均电压(mV)"}, + {"key": "0x0026", "datatype": "uint16", "remark": "单体电压差(mV)"}, + {"key": "0x0027", "datatype": "uint16", "remark": "单体最大温度簇号"}, + {"key": "0x0028", "datatype": "uint16", "remark": "单体最大温度节号"}, + {"key": "0x0029", "datatype": "int16", "remark": "单体最大温度(0.1℃)"}, + {"key": "0x002A", "datatype": "uint16", "remark": "单体最小温度簇号"}, + {"key": "0x002B", "datatype": "uint16", "remark": "单体最小温度节号"}, + {"key": "0x002C", "datatype": "int16", "remark": "单体最小温度(0.1℃)"}, + {"key": "0x002D", "datatype": "int16", "remark": "单体平均温度(0.1℃)"}, + {"key": "0x002E", "datatype": "int16", "remark": "单体温度差(0.1℃)"}, + {"key": "0x002F", "datatype": "uint16", "remark": "最大内阻簇号"}, + {"key": "0x0030", "datatype": "uint16", "remark": "最大内阻节号"}, + {"key": "0x0031", "datatype": "uint16", "remark": "最大内阻(mΩ)"}, + {"key": "0x0032", "datatype": "uint16", "remark": "最小内阻簇号"}, + {"key": "0x0033", "datatype": "uint16", "remark": "最小内阻节号"}, + {"key": "0x0034", "datatype": "uint16", "remark": "最小内阻(mΩ)"}, + {"key": "0x0035", "datatype": "uint16", "remark": "单体平均内阻(mΩ)"}, + {"key": "0x0036", "datatype": "uint16", "remark": "单体内阻差(mΩ)"}, + {"key": "0x0037", "datatype": "uint16", "remark": "单体最大SOH簇号"}, + {"key": "0x0038", "datatype": "uint16", "remark": "单体最大SOH节号"}, + {"key": "0x0039", "datatype": "uint16", "remark": "单体最大SOH(0.001)"}, + {"key": "0x003A", "datatype": "uint16", "remark": "单体最小SOH簇号"}, + {"key": "0x003B", "datatype": "uint16", "remark": "单体最小SOH节号"}, + {"key": "0x003C", "datatype": "uint16", "remark": "单体最小SOH(0.001)"}, + {"key": "0x003D", "datatype": "uint16", "remark": "单体最大SOc簇号"}, + {"key": "0x003E", "datatype": "uint16", "remark": "单体最大SOc节号"}, + {"key": "0x0040", "datatype": "uint16", "remark": "单体最大Soc(0.001)"}, + {"key": "0x0041", "datatype": "uint16", "remark": "单体最小SOc簇号"}, + {"key": "0x0042", "datatype": "uint16", "remark": "单体最小SOc节号"}, + {"key": "0x0043", "datatype": "uint16", "remark": "单体最小SOc(0.001)"}, + {"key": "0x0043", "datatype": "uint32", "remark": "系统剩余最大可充电功率(1KW)"}, + {"key": "0x0045", "datatype": "uint32", "remark": "系统剩余最大可放电功率(1KW)"}, + {"key": "0x0047", "datatype": "uint16", "remark": "可充电状态"}, + {"key": "0x0048", "datatype": "uint16", "remark": "可放电状态"}, + {"key": "0x0049", "datatype": "uint16", "remark": "运行状态"} ] }, - "PCU_YX": { - "count":1, + "BCU_YC":{ "addr":[ - {"key": "0x1001", "datatype": "int16", "remark": "所属通道号 R u 1~4"}, - {"key": "0x1002", "datatype": "int16", "remark": "故障状态 R u 1故障,0正常"}, - {"key": "0x1003", "datatype": "int16", "remark": "告警状态 R u 1告警,0正常"}, - {"key": "0x1004", "datatype": "int16", "remark": "设备在线 R u 1在线,0无效"}, - {"key": "0x1005", "datatype": "int16", "remark": "本地远程 R u 1本地,0远程"}, - {"key": "0x1006", "datatype": "int16", "remark": "启停状态 R u 1开机,0关机"}, - {"key": "0x1007", "datatype": "int16", "remark": "电网状态 R u 1离网,0并网"}, - {"key": "0x1008", "datatype": "int16", "remark": "模块状态 R u 1开机,0待机"}, - {"key": "0x1009", "datatype": "int16", "remark": "EPO急停 R u 1故障,0正常"}, - {"key": "0x100A", "datatype": "int16", "remark": "防雷器异常 R u 1告警,0正常"}, - {"key": "0x100B", "datatype": "int16", "remark": "负载电压反序 R u 1故障,0正常"}, - {"key": "0x100C", "datatype": "int16", "remark": "市电电压反序 R u 1故障,0正常"}, - {"key": "0x100D", "datatype": "int16", "remark": "输出相反序 R u 1故障,0正常"}, - {"key": "0x100E", "datatype": "int16", "remark": "过载告警 R u 1告警,0正常"}, - {"key": "0x100F", "datatype": "int16", "remark": "过载超时 R u 1故障,0正常"}, - {"key": "0x1010", "datatype": "int16", "remark": "交流过流保护 R u 1故障,0正常"}, - {"key": "0x1011", "datatype": "int16", "remark": "逆变电压异常 R u 1故障,0正常"}, - {"key": "0x1012", "datatype": "int16", "remark": "内部串口异常 R u 1故障,0正常"}, - {"key": "0x1013", "datatype": "int16", "remark": "485通信故障 R u 1故障,0正常"}, - {"key": "0x1014", "datatype": "int16", "remark": "CAN通信故障 R u 1故障,0正常"}, - {"key": "0x1015", "datatype": "int16", "remark": "E2PROM故障 R u 1故障,0正常"}, - {"key": "0x1016", "datatype": "int16", "remark": "电网过压 R u 1故障,0正常"}, - {"key": "0x1017", "datatype": "int16", "remark": "电网欠压 R u 1故障,0正常"}, - {"key": "0x1018", "datatype": "int16", "remark": "电网过频 R u 1故障,0正常"}, - {"key": "0x1019", "datatype": "int16", "remark": "电网欠频 R u 1故障,0正常"}, - {"key": "0x101A", "datatype": "int16", "remark": "电网快检综合异常 R u 1故障,0正常"}, - {"key": "0x101B", "datatype": "int16", "remark": "电网幅值快检异常 R u 1故障,0正常"}, - {"key": "0x101C", "datatype": "int16", "remark": "电网拖尾异常 R u 1故障,0正常"}, - {"key": "0x101D", "datatype": "int16", "remark": "消防输入信号NO R u 1闭合,0断开"}, - {"key": "0x101E", "datatype": "int16", "remark": "急停按钮信号NC R u 1急停,0正常"}, - {"key": "0x101F", "datatype": "int16", "remark": "避雷器NC R u 1故障,0正常"}, - {"key": "0x1020", "datatype": "int16", "remark": "避雷器断路器NC R u 1故障,0正常"}, - {"key": "0x1021", "datatype": "int16", "remark": "PCS总断路器NC R u 1闭合,0断开"}, - {"key": "0x1022", "datatype": "int16", "remark": "电操状态NO R u 1闭合,0断开"}, - {"key": "0x1023", "datatype": "int16", "remark": "远程关机NO R u 1开机,0无效"}, - {"key": "0x1024", "datatype": "int16", "remark": "远程开机NO R u 1开机,0无效"}, - {"key": "0x1025", "datatype": "int16", "remark": "BA故障信号NO R u 1故障,0正常"}, - {"key": "0x1026", "datatype": "int16", "remark": "PCS_01状态 R u 1在线,0掉线"}, - {"key": "0x1027", "datatype": "int16", "remark": "PCS_02状态 R u 1在线,0掉线"}, - {"key": "0x1028", "datatype": "int16", "remark": "PCS_03状态 R u 1在线,0掉线"}, - {"key": "0x1029", "datatype": "int16", "remark": "PCS_04状态 R u 1在线,0掉线"}, - {"key": "0x102A", "datatype": "int16", "remark": "PCS_05状态 R u 1在线,0掉线"}, - {"key": "0x102B", "datatype": "int16", "remark": "PCS_06状态 R u 1在线,0掉线"}, - {"key": "0x102C", "datatype": "int16", "remark": "PCS_07状态 R u 1在线,0掉线"}, - {"key": "0x102D", "datatype": "int16", "remark": "PCS_09状态 R u 1在线,0掉线"}, - {"key": "0x102E", "datatype": "int16", "remark": "PCS_10状态 R u 1在线,0掉线"}, - {"key": "0x102F", "datatype": "int16", "remark": "PCS_01下发设置 R u 1故障,0正常"}, - {"key": "0x1030", "datatype": "int16", "remark": "PCS_02下发设置 R u 1故障,0正常"}, - {"key": "0x1031", "datatype": "int16", "remark": "PCS_03下发设置 R u 1故障,0正常"}, - {"key": "0x1032", "datatype": "int16", "remark": "PCS_04下发设置 R u 1故障,0正常"}, - {"key": "0x1033", "datatype": "int16", "remark": "PCS_05下发设置 R u 1故障,0正常"}, - {"key": "0x1034", "datatype": "int16", "remark": "PCS_06下发设置 R u 1故障,0正常"}, - {"key": "0x1035", "datatype": "int16", "remark": "PCS_07下发设置 R u 1故障,0正常"}, - {"key": "0x1036", "datatype": "int16", "remark": "PCS_08下发设置 R u 1故障,0正常"}, - {"key": "0x1037", "datatype": "int16", "remark": "PCS_09下发设置 R u 1故障,0正常"}, - {"key": "0x1038", "datatype": "int16", "remark": "PCS_10下发设置 R u 1:故障,0正常"}, - {"key": "0x1039", "datatype": "int16", "remark": "内部DSP通信故障 R u 1:故障,0正常"}, - {"key": "0x103A", "datatype": "int16", "remark": "BMS CAN通信故障 R u 1:故障,0正常"}, - {"key": "0x103B", "datatype": "int16", "remark": "下发设置失败 R u 1:故障,0正常"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属通道号1~4"}, + {"key": "0x0002", "datatype": "uint16", "remark": "所属BCU号1~40"}, + {"key": "0x0003", "datatype": "uint32", "remark": "簇电压(0.1V)"}, + {"key": "0x0005", "datatype": "int32", "remark": "簇电流(0.1A)"}, + {"key": "0x0007", "datatype": "int32", "remark": "簇温度(0.1℃)"}, + {"key": "0x0009", "datatype": "uint32", "remark": "簇电阻(1mΩ)"}, + {"key": "0x000B", "datatype": "uint16", "remark": "簇SOC(0.1)"}, + {"key": "0x000C", "datatype": "uint16", "remark": "簇SOH(0.1)"}, + {"key": "0x000D", "datatype": "uint32", "remark": "簇正绝缘电阻(1kΩ)"}, + {"key": "0x000F", "datatype": "uint32", "remark": "簇负绝缘电阻(1kΩ)"}, + {"key": "0x0011", "datatype": "int32", "remark": "簇允许最大充电电流(0.1A)"}, + {"key": "0x0013", "datatype": "int32", "remark": "簇允许最大放电电流(0.1A)"}, + {"key": "0x0015", "datatype": "uint32", "remark": "簇允许最大充电功率(1kW)"}, + {"key": "0x0017", "datatype": "uint32", "remark": "簇允许最大放电功率(1kW)"}, + {"key": "0x0019", "datatype": "uint32", "remark": "簇可充容量(0.1Ah)"}, + {"key": "0x001B", "datatype": "uint32", "remark": "簇可放容量(0.1Ah)"}, + {"key": "0x001D", "datatype": "uint32", "remark": "簇单次累计充容量(0.1Ah)"}, + {"key": "0x001F", "datatype": "uint32", "remark": "簇单次累计放容量(0.1Ah)"}, + {"key": "0x0021", "datatype": "uint32", "remark": "簇总累计充容量(0.1Ah)"}, + {"key": "0x0023", "datatype": "uint32", "remark": "簇总累计放容量(0.1Ah)"}, + {"key": "0x0025", "datatype": "uint32", "remark": "簇可充电量(1kWh)"}, + {"key": "0x0027", "datatype": "uint32", "remark": "簇可放电量(1kWh)"}, + {"key": "0x0029", "datatype": "uint32", "remark": "簇单次充电量(1kWh)"}, + {"key": "0x002B", "datatype": "uint32", "remark": "簇单次放电量(1kWh)"}, + {"key": "0x002D", "datatype": "uint32", "remark": "簇累计充电量(1kWh)"}, + {"key": "0x002F", "datatype": "uint32", "remark": "簇累计放电量(1kWh)"}, + {"key": "0x0031", "datatype": "uint32", "remark": "pack累计簇总压(0.1V)"}, + {"key": "0x0033", "datatype": "uint32", "remark": "簇与pack压差(0.1V)"}, + {"key": "0x0035", "datatype": "uint32", "remark": "簇与PCS压差(0.1V)"}, + {"key": "0x0037", "datatype": "uint16", "remark": "簇中BMU个数"}, + {"key": "0x0038", "datatype": "uint16", "remark": "簇中BMU中单体个数"}, + {"key": "0x0039", "datatype": "uint16", "remark": "簇中BMU中温度个数"}, + {"key": "0x003A", "datatype": "uint16", "remark": "簇中单体个数"}, + {"key": "0x003B", "datatype": "uint16", "remark": "簇中温度个数"}, + {"key": "0x003C", "datatype": "uint16", "remark": "单体最高SOC节号"}, + {"key": "0x003D", "datatype": "uint16", "remark": "单体最高SOC(0.1)"}, + {"key": "0x003E", "datatype": "uint16", "remark": "单体最低SOC节号"}, + {"key": "0x003F", "datatype": "uint16", "remark": "单体最低SOC(0.1)"}, + {"key": "0x0040", "datatype": "uint16", "remark": "单体最高SOH节号"}, + {"key": "0x0041", "datatype": "uint16", "remark": "单体最高SOH(0.1)"}, + {"key": "0x0042", "datatype": "uint16", "remark": "单体最低SOH节号"}, + {"key": "0x0043", "datatype": "uint16", "remark": "单体最低SOH(0.1)"}, + {"key": "0x0044", "datatype": "uint16", "remark": "单体最高电压节号"}, + {"key": "0x0045", "datatype": "uint16", "remark": "单体最高电压(mV)"}, + {"key": "0x0046", "datatype": "uint16", "remark": "单体最低电压节号"}, + {"key": "0x0047", "datatype": "uint16", "remark": "单体最低电压(mV)"}, + {"key": "0x0048", "datatype": "uint16", "remark": "单体电压差(mV)"}, + {"key": "0x0049", "datatype": "uint16", "remark": "单体平均电压(mV)"}, + {"key": "0x004A", "datatype": "uint16", "remark": "单体最高温度节号"}, + {"key": "0x004B", "datatype": "int16", "remark": "单体最高温度(0.1℃)"}, + {"key": "0x004C", "datatype": "uint16", "remark": "单体最低温度节号"}, + {"key": "0x004D", "datatype": "int16", "remark": "单体最低温度(0.1℃)"}, + {"key": "0x004E", "datatype": "int16", "remark": "单体温度差(0.1℃)"}, + {"key": "0x004F", "datatype": "int16", "remark": "单体平均温度(0.1℃)"}, + {"key": "0x0050", "datatype": "uint16", "remark": "单体最高内阻节号"}, + {"key": "0x0051", "datatype": "uint16", "remark": "单体最高内阻(mΩ)"}, + {"key": "0x0052", "datatype": "uint16", "remark": "单体最低内阻节号"}, + {"key": "0x0053", "datatype": "uint16", "remark": "单体最低内阻(mΩ)"}, + {"key": "0x0054", "datatype": "uint16", "remark": "单体内阻差(mΩ)"}, + {"key": "0x0055", "datatype": "uint16", "remark": "单体平均内阻(mΩ)"} ] }, - "PCU_YC": { - "count":1, + "BCU_YX":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属通道号 R u 1~4"}, - {"key": "0x0002", "datatype": "int32", "remark": "充电功率最大许可 R u 1KW"}, - {"key": "0x0004", "datatype": "int32", "remark": "放电功率最大许可 R u 1KW"}, - {"key": "0x0006", "datatype": "int32", "remark": "交流日总充电量 R u 1KWh"}, - {"key": "0x0008", "datatype": "int32", "remark": "交流日总放电量 R u 1KWh"}, - {"key": "0x000A", "datatype": "int32", "remark": "交流总充电量 R u 1KWh"}, - {"key": "0x000C", "datatype": "int32", "remark": "交流总放电量 R u 1KWh"}, - {"key": "0x000E", "datatype": "int16", "remark": "有功功率期望值 R 1KW"}, - {"key": "0x000F", "datatype": "int16", "remark": "无功功率期望值 R 1kVar"}, - {"key": "0x0010", "datatype": "int16", "remark": "PCS侧线电压VAB R 1v"}, - {"key": "0x0011", "datatype": "int16", "remark": "PCS侧线电压VBC R 1v"}, - {"key": "0x0012", "datatype": "int16", "remark": "PCS侧线电压VCA R 1v"}, - {"key": "0x0013", "datatype": "int16", "remark": "PCS侧线A相电压 R 1v"}, - {"key": "0x0014", "datatype": "int16", "remark": "PCS侧线B相电压 R 1v"}, - {"key": "0x0015", "datatype": "int16", "remark": "PCS侧线C相电压 R 1v"}, - {"key": "0x0016", "datatype": "int16", "remark": "PCS侧A相频率 R 1Hz"}, - {"key": "0x0017", "datatype": "int16", "remark": "PCS侧B相频率 R 1Hz"}, - {"key": "0x0018", "datatype": "int16", "remark": "PCS侧C相频率 R 1Hz"}, - {"key": "0x0019", "datatype": "int16", "remark": "PCS侧功率因数A R 1"}, - {"key": "0x001A", "datatype": "int16", "remark": "PCS侧功率因数B R 1"}, - {"key": "0x001B", "datatype": "int16", "remark": "PCS侧功率因数C R 1"}, - {"key": "0x001C", "datatype": "int16", "remark": "PCS侧相电流A R 1A"}, - {"key": "0x001D", "datatype": "int16", "remark": "PCS侧相电流B R 1A"}, - {"key": "0x001E", "datatype": "int16", "remark": "PCS侧相电流C R 1A"}, - {"key": "0x001F", "datatype": "int16", "remark": "PCS侧有功功率A R 1kW"}, - {"key": "0x0020", "datatype": "int16", "remark": "PCS侧有功功率B R 1kW"}, - {"key": "0x0021", "datatype": "int16", "remark": "PCS侧有功功率C R 1kW"}, - {"key": "0x0022", "datatype": "int16", "remark": "PCS侧无功功率A R 1kVar"}, - {"key": "0x0023", "datatype": "int16", "remark": "PCS侧无功功率B R 1kVar"}, - {"key": "0x0024", "datatype": "int16", "remark": "PCS侧无功功率C R 1kVar"}, - {"key": "0x0025", "datatype": "int16", "remark": "PCS侧视在功率A R 1kVar"}, - {"key": "0x0026", "datatype": "int16", "remark": "PCS侧视在功率B R 1kVar"}, - {"key": "0x0027", "datatype": "int16", "remark": "PCS侧视在功率C R 1kVar"}, - {"key": "0x0028", "datatype": "int16", "remark": "PCS侧三相总有功功率 R 1kW"}, - {"key": "0x0029", "datatype": "int16", "remark": "PCS侧三相总无功功率 R 1kVar"}, - {"key": "0x002A", "datatype": "int16", "remark": "PCS侧三相总视在功率 R 1kVA"}, - {"key": "0x002B", "datatype": "int16", "remark": "PCS侧三相总功率因数 R 1"}, - {"key": "0x002C", "datatype": "int16", "remark": "PCU模块温度 R 1℃"}, - {"key": "0x002D", "datatype": "int16", "remark": "外部温度NTC1 R 1℃"}, - {"key": "0x002E", "datatype": "int16", "remark": "外部温度NTC2 R 1℃"}, - {"key": "0x002F", "datatype": "int16", "remark": "外部温度NTC3 R 1℃"}, - {"key": "0x0030", "datatype": "int16", "remark": "台区负载侧A相电流 R 1A"}, - {"key": "0x0031", "datatype": "int16", "remark": "台区负载侧B相电流 R 1A"}, - {"key": "0x0032", "datatype": "int16", "remark": "台区负载侧C相电流 R 1A"}, - {"key": "0x0033", "datatype": "int16", "remark": "台区负载侧A相有功功率 R 1kW"}, - {"key": "0x0034", "datatype": "int16", "remark": "台区负载侧B相有功功率 R 1kW"}, - {"key": "0x0035", "datatype": "int16", "remark": "台区负载侧C相有功功率 R 1kW"}, - {"key": "0x0036", "datatype": "int16", "remark": "台区负载侧总有功功率 R 1kW"}, - {"key": "0x0037", "datatype": "int16", "remark": "台区负载侧A相无功功率 R 1kVar"}, - {"key": "0x0038", "datatype": "int16", "remark": "台区负载侧B相无功功率 R 1kVar"}, - {"key": "0x0039", "datatype": "int16", "remark": "台区负载侧C相无功功率 R 1kVar"}, - {"key": "0x003A", "datatype": "int16", "remark": "台区负载侧总无功功率 R 1kVar"}, - {"key": "0x003B", "datatype": "int16", "remark": "台区负载侧A相视在功率 R 1kVA"}, - {"key": "0x003C", "datatype": "int16", "remark": "台区负载侧B相视在功率 R 1kVA"}, - {"key": "0x003D", "datatype": "int16", "remark": "台区负载侧C相视在功率 R 1kVA"}, - {"key": "0x003E", "datatype": "int16", "remark": "台区负载侧总视在功率 R 1kVA"}, - {"key": "0x003F", "datatype": "int16", "remark": "台区负载侧A相功率因数 R 1"}, - {"key": "0x0040", "datatype": "int16", "remark": "台区负载侧B相功率因数 R 1"}, - {"key": "0x0041", "datatype": "int16", "remark": "台区负载侧C相功率因数 R 1"}, - {"key": "0x0042", "datatype": "int16", "remark": "台区负载侧总功率因数 R 1"}, - {"key": "0x0043", "datatype": "int16", "remark": "负载侧线电压AB R 1V"}, - {"key": "0x0044", "datatype": "int16", "remark": "负载侧线电压BC R 1V"}, - {"key": "0x0045", "datatype": "int16", "remark": "负载侧线电压CA R 1V"}, - {"key": "0x0046", "datatype": "int16", "remark": "负载侧相电压AN R 1V"}, - {"key": "0x0047", "datatype": "int16", "remark": "负载侧相电压BN R 1V"}, - {"key": "0x0048", "datatype": "int16", "remark": "负载侧相电压CN R 1V"}, - {"key": "0x0049", "datatype": "int16", "remark": "负载侧A功率因素 R 1"}, - {"key": "0x004A", "datatype": "int16", "remark": "负载侧B功率因素 R 1"}, - {"key": "0x004B", "datatype": "int16", "remark": "负载侧C功率因素 R 1"}, - {"key": "0x004C", "datatype": "int16", "remark": "负载侧A视在功率 R 1kVA"}, - {"key": "0x004D", "datatype": "int16", "remark": "负载侧B视在功率 R 1kVA"}, - {"key": "0x004E", "datatype": "int16", "remark": "负载侧C视在功率 R 1kVA"} + {"key": "0xA001", "datatype": "uint16", "remark": "所属通道号1~4"}, + {"key": "0xA002", "datatype": "uint16", "remark": "所属BCU号1~40"}, + {"key": "0xA003", "datatype": "uint16", "remark": "蓄电池充放电状态0x11开路0x22待机0x33充电0x44放电"}, + {"key": "0xA004", "datatype": "uint16", "remark": "电池组运行状态0x11跳机 0x22待机 0x33放空 0x44充满 0x55预警 0x66正常"}, + {"key": "0xA005", "datatype": "uint16", "remark": "簇DO1状态1:断开 2:闭合"}, + {"key": "0xA006", "datatype": "uint16", "remark": "簇DO2状态1:断开 2:闭合"}, + {"key": "0xA007", "datatype": "uint16", "remark": "继电器总正0:断开 1:闭合 2:粘连"}, + {"key": "0xA008", "datatype": "uint16", "remark": "继电器总负0:断开 1:闭合 2:粘连"}, + {"key": "0xA009", "datatype": "uint16", "remark": "继电器预充0:断开 1:闭合 2:粘连"}, + {"key": "0xA00A", "datatype": "uint16", "remark": "继电器bmu供电0:断开 1:闭合 2:粘连"}, + {"key": "0xA00B", "datatype": "uint16", "remark": "整簇总电压过高告警0:正常 1:告警"}, + {"key": "0xA00C", "datatype": "uint16", "remark": "整簇总电压过低告警0:正常 1:告警"}, + {"key": "0xA00D", "datatype": "uint16", "remark": "整簇中单体电压过高告警0:正常 1:告警"}, + {"key": "0xA00E", "datatype": "uint16", "remark": "整簇中单体电压过低告警0:正常 1:告警"}, + {"key": "0xA00F", "datatype": "uint16", "remark": "整簇中单体电压偏差过大告警0:正常 1:告警"}, + {"key": "0xA010", "datatype": "uint16", "remark": "整簇中单体温度偏差过大告警0:正常 1:告警"}, + {"key": "0xA011", "datatype": "uint16", "remark": "整簇中单体温度过高告警0:正常 1:告警"}, + {"key": "0xA012", "datatype": "uint16", "remark": "整簇中单体温度过低告警0:正常 1:告警"}, + {"key": "0xA013", "datatype": "uint16", "remark": "整簇总充电电流过高告警0:正常 1:告警"}, + {"key": "0xA014", "datatype": "uint16", "remark": "整簇总放电电流过高告警0:正常 1:告警"}, + {"key": "0xA015", "datatype": "uint16", "remark": "整簇总SOC过高告警0:正常 1:告警"}, + {"key": "0xA016", "datatype": "uint16", "remark": "整簇总SOC过低告警0:正常 1:告警"}, + {"key": "0xA017", "datatype": "uint16", "remark": "高压盒主正接触器粘连告警0:正常 1:告警"}, + {"key": "0xA018", "datatype": "uint16", "remark": "高压盒主正接触器不能吸合告警0:正常 1:告警"}, + {"key": "0xA019", "datatype": "uint16", "remark": "高压盒主负接触器粘连告警0:正常 1:告警"}, + {"key": "0xA01A", "datatype": "uint16", "remark": "高压盒主负接触器不能吸合告警0:正常 1:告警"}, + {"key": "0xA01B", "datatype": "uint16", "remark": "高压盒预充接触器粘连告警0:正常 1:告警"}, + {"key": "0xA01C", "datatype": "uint16", "remark": "高压盒预充接触器不能吸合告警0:正常 1:告警"}, + {"key": "0xA01D", "datatype": "uint16", "remark": "预充失败告警0:正常 1:告警"}, + {"key": "0xA01E", "datatype": "uint16", "remark": "BCU电压检测模块出现问题告警0:正常 1:告警"}, + {"key": "0xA01F", "datatype": "uint16", "remark": "BCU温度检测模块出现问题告警0:正常 1:告警"}, + {"key": "0xA020", "datatype": "uint16", "remark": "BCU电流检测模块出现问题告警0:正常 1:告警"}, + {"key": "0xA021", "datatype": "uint16", "remark": "BCU绝缘检测模块出现问题告警0:正常 1:告警"}, + {"key": "0xA022", "datatype": "uint16", "remark": "高压盒内总压检测模块出现问题告警0:正常 1:告警"}, + {"key": "0xA023", "datatype": "uint16", "remark": "高压盒外总压检测模块出现问题告警0:正常 1:告警"}, + {"key": "0xA024", "datatype": "uint16", "remark": "PCS-CAN通信故障告警0:正常 1:告警"}, + {"key": "0xA025", "datatype": "uint16", "remark": "高压盒供电电压过高告警0:正常 1:告警"}, + {"key": "0xA026", "datatype": "uint16", "remark": "绝缘正极故障告警0:正常 1:告警"}, + {"key": "0xA027", "datatype": "uint16", "remark": "绝缘负极故障告警0:正常 1:告警"}, + {"key": "0xA028", "datatype": "uint16", "remark": "绝缘中间侧故障告警0:正常 1:告警"}, + {"key": "0xA029", "datatype": "uint16", "remark": "绝缘故障告警0:正常 1:告警"}, + {"key": "0xA02A", "datatype": "uint16", "remark": "BMU中电压采样线开路告警0:正常 1:告警"}, + {"key": "0xA02B", "datatype": "uint16", "remark": "BMU中NTC采样线短开路告警0:正常 1:告警"}, + {"key": "0xA02C", "datatype": "uint16", "remark": "BMU中采样芯片故障告警0:正常 1:告警"}, + {"key": "0xA02D", "datatype": "uint16", "remark": "BMU中电池温度升高过快告警0:正常 1:告警"}, + {"key": "0xA02E", "datatype": "uint16", "remark": "BMU中电池内部短路告警0:正常 1:告警"}, + {"key": "0xA02F", "datatype": "uint16", "remark": "BMU充电均衡模块出现故障告警0:正常 1:告警"}, + {"key": "0xA030", "datatype": "uint16", "remark": "BMU放电均衡模块出现故障告警0:正常 1:告警"}, + {"key": "0xA031", "datatype": "uint16", "remark": "BMU通信故障告警0:正常 1:告警"}, + {"key": "0xA032", "datatype": "uint16", "remark": "单体内阻过大告警0:正常 1:告警"}, + {"key": "0xA033", "datatype": "uint16", "remark": "单体内阻过小告警0:正常 1:告警"}, + {"key": "0xA034", "datatype": "uint16", "remark": "单体内阻阻差过大告警0:正常 1:告警"}, + {"key": "0xA035", "datatype": "uint16", "remark": "簇内阻过大告警0:正常 1:告警"}, + {"key": "0xA036", "datatype": "uint16", "remark": "簇内阻过小告警0:正常 1:告警"}, + {"key": "0xA037", "datatype": "uint16", "remark": "SOC初始化无效告警0:正常 1:告警"}, + {"key": "0xA038", "datatype": "uint16", "remark": "充电时soc降低故障告警0:正常 1:告警"}, + {"key": "0xA039", "datatype": "uint16", "remark": "放电时soc升高告警0:正常 1:告警"}, + {"key": "0xA03A", "datatype": "uint16", "remark": "静止时SOC跳变告警0:正常 1:告警"}, + {"key": "0xA03B", "datatype": "uint16", "remark": "整簇总电压过高保护0:正常 1:保护"}, + {"key": "0xA03C", "datatype": "uint16", "remark": "整簇总电压过低保护0:正常 1:保护"}, + {"key": "0xA03D", "datatype": "uint16", "remark": "整簇中单体电压过高保护0:正常 1:保护"}, + {"key": "0xA03E", "datatype": "uint16", "remark": "整簇中单体电压过低保护0:正常 1:保护"}, + {"key": "0xA03F", "datatype": "uint16", "remark": "整簇中单体电压偏差过大保护0:正常 1:保护"}, + {"key": "0xA040", "datatype": "uint16", "remark": "整簇中单体温度偏差过大保护0:正常 1:保护"}, + {"key": "0xA041", "datatype": "uint16", "remark": "整簇中单体温度过高保护0:正常 1:保护"}, + {"key": "0xA042", "datatype": "uint16", "remark": "整簇中单体温度过低保护0:正常 1:保护"}, + {"key": "0xA043", "datatype": "uint16", "remark": "整簇总充电电流过高保护0:正常 1:保护"}, + {"key": "0xA044", "datatype": "uint16", "remark": "整簇总放电电流过高保护0:正常 1:保护"}, + {"key": "0xA045", "datatype": "uint16", "remark": "整簇总SOC过高保护0:正常 1:保护"}, + {"key": "0xA046", "datatype": "uint16", "remark": "整簇总SOC过低保护0:正常 1:保护"}, + {"key": "0xA047", "datatype": "uint16", "remark": "高压盒主正接触器粘连保护0:正常 1:保护"}, + {"key": "0xA048", "datatype": "uint16", "remark": "高压盒主正接触器不能吸合保护0:正常 1:保护"}, + {"key": "0xA049", "datatype": "uint16", "remark": "高压盒主负接触器粘连保护0:正常 1:保护"}, + {"key": "0xA04A", "datatype": "uint16", "remark": "高压盒主负接触器不能吸合保护0:正常 1:保护"}, + {"key": "0xA04B", "datatype": "uint16", "remark": "高压盒预充接触器粘连保护0:正常 1:保护"}, + {"key": "0xA04C", "datatype": "uint16", "remark": "高压盒预充接触器不能吸合保护0:正常 1:保护"}, + {"key": "0xA04D", "datatype": "uint16", "remark": "预充失败保护0:正常 1:保护"}, + {"key": "0xA04E", "datatype": "uint16", "remark": "BCU电压检测模块出现问题保护0:正常 1:保护"}, + {"key": "0xA04F", "datatype": "uint16", "remark": "BCU温度检测模块出现问题保护0:正常 1:保护"}, + {"key": "0xA050", "datatype": "uint16", "remark": "BCU电流检测模块出现问题保护0:正常 1:保护"}, + {"key": "0xA051", "datatype": "uint16", "remark": "BCU绝缘检测模块出现问题保护0:正常 1:保护"}, + {"key": "0xA052", "datatype": "uint16", "remark": "高压盒内总压检测模块出现问题保护0:正常 1:保护"}, + {"key": "0xA053", "datatype": "uint16", "remark": "高压盒外总压检测模块出现问题保护0:正常 1:保护"}, + {"key": "0xA054", "datatype": "uint16", "remark": "PCS-CAN通信故障保护0:正常 1:保护"}, + {"key": "0xA055", "datatype": "uint16", "remark": "高压盒供电电压过高保护0:正常 1:保护"}, + {"key": "0xA056", "datatype": "uint16", "remark": "绝缘正极故障保护0:正常 1:保护"}, + {"key": "0xA057", "datatype": "uint16", "remark": "绝缘负极故障保护0:正常 1:保护"}, + {"key": "0xA058", "datatype": "uint16", "remark": "绝缘中间侧故障保护0:正常 1:保护"}, + {"key": "0xA059", "datatype": "uint16", "remark": "绝缘故障保护0:正常 1:保护"}, + {"key": "0xA05A", "datatype": "uint16", "remark": "BMU中电压采样线开路保护0:正常 1:保护"}, + {"key": "0xA05B", "datatype": "uint16", "remark": "BMU中NTC采样线短开路保护0:正常 1:保护"}, + {"key": "0xA05C", "datatype": "uint16", "remark": "BMU中采样芯片故障保护0:正常 1:保护"}, + {"key": "0xA05D", "datatype": "uint16", "remark": "BMU中电池温度升高过快保护0:正常 1:保护"}, + {"key": "0xA05E", "datatype": "uint16", "remark": "BMU中电池内部短路保护0:正常 1:保护"}, + {"key": "0xA05F", "datatype": "uint16", "remark": "BMU充电均衡模块出现故障保护0:正常 1:保护"}, + {"key": "0xA060", "datatype": "uint16", "remark": "BMU放电均衡模块出现故障保护0:正常 1:保护"}, + {"key": "0xA061", "datatype": "uint16", "remark": "BMU通信故障保护0:正常 1:保护"}, + {"key": "0xA062", "datatype": "uint16", "remark": "单体内阻过大保护0:正常 1:保护"}, + {"key": "0xA063", "datatype": "uint16", "remark": "单体内阻过小保护0:正常 1:保护"}, + {"key": "0xA064", "datatype": "uint16", "remark": "单体内阻阻差过大保护0:正常 1:保护"}, + {"key": "0xA065", "datatype": "uint16", "remark": "簇内阻过大保护0:正常 1:保护"}, + {"key": "0xA066", "datatype": "uint16", "remark": "簇内阻过小保护0:正常 1:保护"}, + {"key": "0xA067", "datatype": "uint16", "remark": "SOC初始化无效保护0:正常 1:保护"}, + {"key": "0xA068", "datatype": "uint16", "remark": "充电时soc降低故障保护0:正常 1:保护"}, + {"key": "0xA069", "datatype": "uint16", "remark": "放电时soc升高保护0:正常 1:保护"}, + {"key": "0xA06A", "datatype": "uint16", "remark": "静止时SOC跳变保护0:正常 1:保护"} ] }, - "MEM_YC": { - "count":1, + "MEM_YC":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属通道号 R u 1"}, - {"key": "0x0002", "datatype": "int16", "remark": "电表地址 R u[6]"}, - {"key": "0x0008", "datatype": "int16", "remark": "电表类型 R u 0:储能站总表1:逆变前侧电表2:逆变后侧电表3:配电柜电表4:并网口电表"}, - {"key": "0x0009", "datatype": "int16", "remark": "电流变比 R u"}, - {"key": "0x000A", "datatype": "int16", "remark": "电压变比 R u"}, - {"key": "0x000B", "datatype": "int32", "remark": "A相电压 R u 1V"}, - {"key": "0x000D", "datatype": "int32", "remark": "B相电压 R u 1V"}, - {"key": "0x000F", "datatype": "int32", "remark": "C相电压 R u 1V"}, - {"key": "0x0011", "datatype": "int32", "remark": "A相电流 R 1A"}, - {"key": "0x0013", "datatype": "int32", "remark": "B相电流 R 1A"}, - {"key": "0x0015", "datatype": "int32", "remark": "C相电流 R 1A"}, - {"key": "0x0017", "datatype": "int32", "remark": "AB相电压 R u 1V"}, - {"key": "0x0019", "datatype": "int32", "remark": "BC相电压 R u 1V"}, - {"key": "0x001B", "datatype": "int32", "remark": "CA相电压 R u 1V"}, - {"key": "0x001D", "datatype": "int32", "remark": "A相有功 R 1kW"}, - {"key": "0x001F", "datatype": "int32", "remark": "B相有功 R 1kW"}, - {"key": "0x0021", "datatype": "int32", "remark": "C相有功 R 1kW"}, - {"key": "0x0023", "datatype": "int32", "remark": "三相总有功 R 1kW"}, - {"key": "0x0025", "datatype": "int32", "remark": "正向总有功总需量 R 1kW"}, - {"key": "0x0027", "datatype": "int32", "remark": "尖段电价 R u 1RMB"}, - {"key": "0x0029", "datatype": "int32", "remark": "峰段电价 R u 1RMB"}, - {"key": "0x002B", "datatype": "int32", "remark": "平段电价 R u 1RMB"}, - {"key": "0x002D", "datatype": "int32", "remark": "谷段电价 R u 1RMB"}, - {"key": "0x002F", "datatype": "int32", "remark": "日充电电量 R u 1kWh"}, - {"key": "0x0031", "datatype": "int32", "remark": "日放电电量 R u 1kWh"}, - {"key": "0x0033", "datatype": "int32", "remark": "日充电费用 R u 1RMB"}, - {"key": "0x0035", "datatype": "int32", "remark": "日放电费用 R u 1RMB"}, - {"key": "0x0037", "datatype": "int32", "remark": "日收益 R 1RMB"}, - {"key": "0x0039", "datatype": "int32", "remark": "日正向尖有功电能 R u 1kWh"}, - {"key": "0x003B", "datatype": "int32", "remark": "日正向峰有功电能 R u 1kWh"}, - {"key": "0x003D", "datatype": "int32", "remark": "日正向平有功电能 R u 1kWh"}, - {"key": "0x003F", "datatype": "int32", "remark": "日正向谷有功电能 R u 1kWh"}, - {"key": "0x0041", "datatype": "int32", "remark": "日正向总有功电能 R u 1kWh"}, - {"key": "0x0043", "datatype": "int32", "remark": "日反向尖有功电能 R u 1kWh"}, - {"key": "0x0045", "datatype": "int32", "remark": "日反向峰有功电能 R u 1kWh"}, - {"key": "0x0047", "datatype": "int32", "remark": "日反向平有功电能 R u 1kWh"}, - {"key": "0x0049", "datatype": "int32", "remark": "日反向谷有功电能 R u 1kWh"}, - {"key": "0x004B", "datatype": "int32", "remark": "日反向总有功电能 R u 1kWh"}, - {"key": "0x004D", "datatype": "int32", "remark": "总充电电量 R u 1kWh"}, - {"key": "0x004F", "datatype": "int32", "remark": "总放电电量 R u 1kWh"}, - {"key": "0x0051", "datatype": "int32", "remark": "总充电费用 R u 1RMB"}, - {"key": "0x0053", "datatype": "int32", "remark": "总放电费用 R u 1RMB"}, - {"key": "0x0055", "datatype": "int32", "remark": "总收益 R 1RMB"}, - {"key": "0x0057", "datatype": "int32", "remark": "总正向尖有功电能 R u 1kWh"}, - {"key": "0x0059", "datatype": "int32", "remark": "总正向峰有功电能 R u 1kWh"}, - {"key": "0x005B", "datatype": "int32", "remark": "总正向平有功电能 R u 1kWh"}, - {"key": "0x005D", "datatype": "int32", "remark": "总正向谷有功电能 R u 1kWh"}, - {"key": "0x005F", "datatype": "int32", "remark": "总正向总有功电能 R u 1kWh"}, - {"key": "0x0061", "datatype": "int32", "remark": "总反向尖有功电能 R u 1kWh"}, - {"key": "0x0063", "datatype": "int32", "remark": "总反向峰有功电能 R u 1kWh"}, - {"key": "0x0065", "datatype": "int32", "remark": "总反向平有功电能 R u 1kWh"}, - {"key": "0x0067", "datatype": "int32", "remark": "总反向谷有功电能 R u 1kWh"}, - {"key": "0x0069", "datatype": "int32", "remark": "总反向总有功电能 R u 1kWh"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属通道号1"}, + {"key": "0x0008", "datatype": "uint16", "remark": "电表类型0:储能站总表1:逆变前侧电表2:逆变后侧电表3:配电柜电表4:并网口电表"}, + {"key": "0x0009", "datatype": "uint16", "remark": "电流变比"}, + {"key": "0x000A", "datatype": "uint16", "remark": "电压变比"}, + {"key": "0x000B", "datatype": "uint32", "remark": "A相电压(1V)"}, + {"key": "0x000D", "datatype": "uint32", "remark": "B相电压(1V)"}, + {"key": "0x000F", "datatype": "uint32", "remark": "C相电压(1V)"}, + {"key": "0x0011", "datatype": "int32", "remark": "A相电流(1A)"}, + {"key": "0x0013", "datatype": "int32", "remark": "B相电流(1A)"}, + {"key": "0x0015", "datatype": "int32", "remark": "C相电流(1A)"}, + {"key": "0x0017", "datatype": "uint32", "remark": "AB相电压(1V)"}, + {"key": "0x0019", "datatype": "uint32", "remark": "BC相电压(1V)"}, + {"key": "0x001B", "datatype": "uint32", "remark": "CA相电压(1V)"}, + {"key": "0x001D", "datatype": "int32", "remark": "A相有功(1kW)"}, + {"key": "0x001F", "datatype": "int32", "remark": "B相有功(1kW)"}, + {"key": "0x0021", "datatype": "int32", "remark": "C相有功(1kW)"}, + {"key": "0x0023", "datatype": "int32", "remark": "三相总有功(1kW)"}, + {"key": "0x0025", "datatype": "int32", "remark": "正向总有功总需量(1kW)"}, + {"key": "0x0027", "datatype": "uint32", "remark": "尖段电价(1RMB)"}, + {"key": "0x0029", "datatype": "uint32", "remark": "峰段电价(1RMB)"}, + {"key": "0x002B", "datatype": "uint32", "remark": "平段电价(1RMB)"}, + {"key": "0x002D", "datatype": "uint32", "remark": "谷段电价(1RMB)"}, + {"key": "0x002F", "datatype": "uint32", "remark": "日充电电量(1kWh)"}, + {"key": "0x0031", "datatype": "uint32", "remark": "日放电电量(1kWh)"}, + {"key": "0x0033", "datatype": "uint32", "remark": "日充电费用(1RMB)"}, + {"key": "0x0035", "datatype": "uint32", "remark": "日放电费用(1RMB)"}, + {"key": "0x0037", "datatype": "int32", "remark": "日收益(1RMB)"}, + {"key": "0x0039", "datatype": "uint32", "remark": "日正向尖有功电能(1kWh)"}, + {"key": "0x003B", "datatype": "uint32", "remark": "日正向峰有功电能(1kWh)"}, + {"key": "0x003D", "datatype": "uint32", "remark": "日正向平有功电能(1kWh)"}, + {"key": "0x003F", "datatype": "uint32", "remark": "日正向谷有功电能(1kWh)"}, + {"key": "0x0041", "datatype": "uint32", "remark": "日正向总有功电能(1kWh)"}, + {"key": "0x0043", "datatype": "uint32", "remark": "日反向尖有功电能(1kWh)"}, + {"key": "0x0045", "datatype": "uint32", "remark": "日反向峰有功电能(1kWh)"}, + {"key": "0x0047", "datatype": "uint32", "remark": "日反向平有功电能(1kWh)"}, + {"key": "0x0049", "datatype": "uint32", "remark": "日反向谷有功电能(1kWh)"}, + {"key": "0x004B", "datatype": "uint32", "remark": "日反向总有功电能(1kWh)"}, + {"key": "0x004D", "datatype": "uint32", "remark": "总充电电量(1kWh)"}, + {"key": "0x004F", "datatype": "uint32", "remark": "总放电电量(1kWh)"}, + {"key": "0x0051", "datatype": "uint32", "remark": "总充电费用(1RMB)"}, + {"key": "0x0053", "datatype": "uint32", "remark": "总放电费用(1RMB)"}, + {"key": "0x0055", "datatype": "int32", "remark": "总收益(1RMB)"}, + {"key": "0x0057", "datatype": "uint32", "remark": "总正向尖有功电能(1kWh)"}, + {"key": "0x0059", "datatype": "uint32", "remark": "总正向峰有功电能(1kWh)"}, + {"key": "0x005B", "datatype": "uint32", "remark": "总正向平有功电能(1kWh)"}, + {"key": "0x005D", "datatype": "uint32", "remark": "总正向谷有功电能(1kWh)"}, + {"key": "0x005F", "datatype": "uint32", "remark": "总正向总有功电能(1kWh)"}, + {"key": "0x0061", "datatype": "uint32", "remark": "总反向尖有功电能(1kWh)"}, + {"key": "0x0063", "datatype": "uint32", "remark": "总反向峰有功电能(1kWh)"}, + {"key": "0x0065", "datatype": "uint32", "remark": "总反向平有功电能(1kWh)"}, + {"key": "0x0067", "datatype": "uint32", "remark": "总反向谷有功电能(1kWh)"}, + {"key": "0x0069", "datatype": "uint32", "remark": "总反向总有功电能(1kWh)"} ] }, - "TH_YC": { - "count":1, + "TH_YC":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属通道号 R u 1"}, - {"key": "0x0002", "datatype": "int16", "remark": "所属温湿度号 R u 1~10"}, - {"key": "0x0003", "datatype": "int16", "remark": "温度 R 0.1℃"}, - {"key": "0x0004", "datatype": "int16", "remark": "湿度 R 0.1℃"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属通道号1"}, + {"key": "0x0002", "datatype": "uint16", "remark": "所属温湿度号1~10"}, + {"key": "0x0003", "datatype": "int16", "remark": "温度(0.1℃)"} ] }, - "Fire40_YX": { - "count":1, + "Fire40_YX":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属通道号 R u 1~10"}, - {"key": "0x0002", "datatype": "int16", "remark": "主控数量 R u 1"}, - {"key": "0x0003", "datatype": "int16", "remark": "主控ID R u 1"}, - {"key": "0x0004", "datatype": "int16", "remark": "主控状态 R u 0:正常 1:预警 2:火警"}, - {"key": "0x0005", "datatype": "int16", "remark": "主控硬件版本 R u[2] 主控硬件版本"}, - {"key": "0x0007", "datatype": "int16", "remark": "主控软件版本 R u[2] 主控软件版本"}, - {"key": "0x0009", "datatype": "int16", "remark": "主电状态 R u 0:使用市电 1:使用备电"}, - {"key": "0x000A", "datatype": "int32", "remark": "备电电流 R u 0.1A"}, - {"key": "0x000C", "datatype": "int32", "remark": "备电电压 R u 0.1V"}, - {"key": "0x000E", "datatype": "int32", "remark": "可用容量 R u 0.01Ah"}, - {"key": "0x0010", "datatype": "int32", "remark": "可充放容量 R u 0.01Ah"}, - {"key": "0x0012", "datatype": "int16", "remark": "警铃是否使用 R u"}, - {"key": "0x0013", "datatype": "int16", "remark": "警铃状态 R u 0:无效 1:掉线 2:正常 3:启动"}, - {"key": "0x0014", "datatype": "int16", "remark": "瓶头阀是否使用 R u"}, - {"key": "0x0015", "datatype": "int16", "remark": "瓶头阀状态 R u 0:无效 1:掉线 2:正常 3:启动"}, - {"key": "0x0016", "datatype": "int16", "remark": "手报是否使用 R u"}, - {"key": "0x0017", "datatype": "int16", "remark": "手报状态 R u 0:无效 1:掉线 2:正常 3:启动"}, - {"key": "0x0018", "datatype": "int16", "remark": "簇控制器数量 R u"}, - {"key": "0x0019", "datatype": "int16", "remark": "复合探测器总数量 R u"}, - {"key": "0x001A", "datatype": "int16", "remark": "烟雾探测器总数量 R u"}, - {"key": "0x001B", "datatype": "int16", "remark": "压力探测器总数量 R u"}, - {"key": "0x001C", "datatype": "int16", "remark": "吸气式探测器总数量 R u"}, - {"key": "0x001D", "datatype": "int16", "remark": "PACK探测器总数量 R u"}, - {"key": "0x001E", "datatype": "int16", "remark": "电池总数量 R u"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属通道号1~10"}, + {"key": "0x0002", "datatype": "uint16", "remark": "主控数量1"}, + {"key": "0x0003", "datatype": "uint16", "remark": "主控ID1"}, + {"key": "0x0004", "datatype": "uint16", "remark": "主控状态0:正常 1:预警 2:火警"}, + {"key": "0x0009", "datatype": "uint16", "remark": "主电状态0:使用市电 1:使用备电"}, + {"key": "0x000A", "datatype": "uint32", "remark": "备电电流(0.1A)"}, + {"key": "0x000C", "datatype": "uint32", "remark": "备电电压(0.1V)"}, + {"key": "0x000E", "datatype": "uint32", "remark": "可用容量(0.01Ah)"}, + {"key": "0x0010", "datatype": "uint32", "remark": "可充放容量(0.01Ah)"}, + {"key": "0x0012", "datatype": "uint16", "remark": "警铃是否使用"}, + {"key": "0x0013", "datatype": "uint16", "remark": "警铃状态0:无效 1:掉线 2:正常 3:启动"}, + {"key": "0x0014", "datatype": "uint16", "remark": "瓶头阀是否使用"}, + {"key": "0x0015", "datatype": "uint16", "remark": "瓶头阀状态0:无效 1:掉线 2:正常 3:启动"}, + {"key": "0x0016", "datatype": "uint16", "remark": "手报是否使用"}, + {"key": "0x0017", "datatype": "uint16", "remark": "手报状态0:无效 1:掉线 2:正常 3:启动"}, + {"key": "0x0018", "datatype": "uint16", "remark": "簇控制器数量"}, + {"key": "0x0019", "datatype": "uint16", "remark": "复合探测器总数量"}, + {"key": "0x001A", "datatype": "uint16", "remark": "烟雾探测器总数量"}, + {"key": "0x001B", "datatype": "uint16", "remark": "压力探测器总数量"}, + {"key": "0x001C", "datatype": "uint16", "remark": "吸气式探测器总数量"}, + {"key": "0x001D", "datatype": "uint16", "remark": "PACK探测器总数量"}, + {"key": "0x001E", "datatype": "uint16", "remark": "电池总数量"} ] }, - "Cooling_YX": { - "count":1, + "Cooling_YC":{ "addr":[ - {"key": "0x1001", "datatype": "int16", "remark": "所属通道号 R u 1"}, - {"key": "0x1002", "datatype": "int16", "remark": "所属冷机号 R u 1~10"}, - {"key": "0x1003", "datatype": "int16", "remark": "开关 R u 0:关机,1:开机"}, - {"key": "0x1004", "datatype": "int16", "remark": "采样模式 R u 0-出水温度 1-电芯温度"}, - {"key": "0x1005", "datatype": "int16", "remark": "制冷状态 R u 0:关闭,1:启动"}, - {"key": "0x1006", "datatype": "int16", "remark": "制热状态 R u 0:关闭,1:启动"}, - {"key": "0x1007", "datatype": "int16", "remark": "高温告警 R u 0:正常,1:告警"}, - {"key": "0x1008", "datatype": "int16", "remark": "低温告警 R u 0:正常,1:告警"}, - {"key": "0x1009", "datatype": "int16", "remark": "高压告警 R u 0:正常,1:告警"}, - {"key": "0x100A", "datatype": "int16", "remark": "低压告警 R u 0:正常,1:告警"}, - {"key": "0x100B", "datatype": "int16", "remark": "进水温度传感器 R u 0:正常,1:告警"}, - {"key": "0x100C", "datatype": "int16", "remark": "出水温度传感器 R u 0:正常,1:告警"}, - {"key": "0x100D", "datatype": "int16", "remark": "进水压力传感器 R u 0:正常,1:告警"}, - {"key": "0x100E", "datatype": "int16", "remark": "出水压力传感器 R u 0:正常,1:告警"} + {"key": "0x0001", "datatype": "uint16", "remark": "所属通道号1"}, + {"key": "0x0002", "datatype": "uint16", "remark": "所属冷机号1~10"}, + {"key": "0x0003", "datatype": "int16", "remark": "制冷点(0.1℃)"}, + {"key": "0x0004", "datatype": "int16", "remark": "制冷偏差(0.1℃)"}, + {"key": "0x0005", "datatype": "int16", "remark": "高温告警值(0.1℃)"}, + {"key": "0x0006", "datatype": "int16", "remark": "低温告警值(0.1℃)"}, + {"key": "0x0007", "datatype": "int16", "remark": "制热点(0.1℃)"}, + {"key": "0x0008", "datatype": "int16", "remark": "制热偏差(0.1℃)"}, + {"key": "0x0009", "datatype": "int16", "remark": "电芯温度(0.1℃)"}, + {"key": "0x000A", "datatype": "int16", "remark": "环境湿度(0.1℃)"}, + {"key": "0x000B", "datatype": "int16", "remark": "吸气温度(0.1℃)"}, + {"key": "0x000C", "datatype": "int16", "remark": "排气温度(0.1℃)"}, + {"key": "0x000D", "datatype": "int16", "remark": "进水温度/供液温度(0.1℃)"}, + {"key": "0x000E", "datatype": "int16", "remark": "出水温度/回液温度(0.1℃)"}, + {"key": "0x000F", "datatype": "int16", "remark": "进水压力/供液压力(0.1)"}, + {"key": "0x0010", "datatype": "int16", "remark": "出水压力/回液压力(0.1)"}, + {"key": "0x0011", "datatype": "int16", "remark": "高压压力(0.1)"}, + {"key": "0x0012", "datatype": "int16", "remark": "低压压力(0.1)"}, + {"key": "0x0013", "datatype": "int16", "remark": "循环水泵转速"}, + {"key": "0x0014", "datatype": "int16", "remark": "压缩机频率"}, + {"key": "0x0015", "datatype": "int16", "remark": "室外风机转速"} ] }, - "Cooling_YC": { - "count":1, + "Cooling_YX":{ "addr":[ - {"key": "0x0001", "datatype": "int16", "remark": "所属通道号 R u 1"}, - {"key": "0x0002", "datatype": "int16", "remark": "所属冷机号 R u 1~10"}, - {"key": "0x0003", "datatype": "int16", "remark": "制冷点 R 0.1℃"}, - {"key": "0x0004", "datatype": "int16", "remark": "制冷偏差 R 0.1℃"}, - {"key": "0x0005", "datatype": "int16", "remark": "高温告警值 R 0.1℃"}, - {"key": "0x0006", "datatype": "int16", "remark": "低温告警值 R 0.1℃"}, - {"key": "0x0007", "datatype": "int16", "remark": "制热点 R 0.1℃"}, - {"key": "0x0008", "datatype": "int16", "remark": "制热偏差 R 0.1℃"}, - {"key": "0x0009", "datatype": "int16", "remark": "电芯温度 R 0.1℃"}, - {"key": "0x000A", "datatype": "int16", "remark": "环境湿度 R 0.1℃"}, - {"key": "0x000B", "datatype": "int16", "remark": "吸气温度 R 0.1℃"}, - {"key": "0x000C", "datatype": "int16", "remark": "排气温度 R 0.1℃"}, - {"key": "0x000D", "datatype": "int16", "remark": "进水温度/供液温度 R 0.1℃"}, - {"key": "0x000E", "datatype": "int16", "remark": "出水温度/回液温度 R 0.1℃"}, - {"key": "0x000F", "datatype": "int16", "remark": "进水压力/供液压力 R 0.1"}, - {"key": "0x0010", "datatype": "int16", "remark": "出水压力/回液压力 R 0.1"}, - {"key": "0x0011", "datatype": "int16", "remark": "高压压力 R 0.1"}, - {"key": "0x0012", "datatype": "int16", "remark": "低压压力 R 0.1"}, - {"key": "0x0013", "datatype": "int16", "remark": "循环水泵转速 R "}, - {"key": "0x0014", "datatype": "int16", "remark": "压缩机频率 R "}, - {"key": "0x0015", "datatype": "int16", "remark": "室外风机转速 R "} + {"key": "0x1001", "datatype": "uint16", "remark": "所属通道号1"}, + {"key": "0x1002", "datatype": "uint16", "remark": "所属冷机号1~10"}, + {"key": "0x1003", "datatype": "uint16", "remark": "开关0:关机,1:开机"}, + {"key": "0x1004", "datatype": "uint16", "remark": "采样模式(0-出水温度 1-电芯温度)"}, + {"key": "0x1005", "datatype": "uint16", "remark": "制冷状态0:关闭,1:启动"}, + {"key": "0x1006", "datatype": "uint16", "remark": "制热状态0:关闭,1:启动"}, + {"key": "0x1007", "datatype": "uint16", "remark": "高温告警0:正常,1:告警"}, + {"key": "0x1008", "datatype": "uint16", "remark": "低温告警0:正常,1:告警"}, + {"key": "0x1009", "datatype": "uint16", "remark": "高压告警0:正常,1:告警"}, + {"key": "0x100A", "datatype": "uint16", "remark": "低压告警0:正常,1:告警"}, + {"key": "0x100B", "datatype": "uint16", "remark": "进水温度传感器0:正常,1:告警"}, + {"key": "0x100C", "datatype": "uint16", "remark": "出水温度传感器0:正常,1:告警"}, + {"key": "0x100D", "datatype": "uint16", "remark": "进水压力传感器0:正常,1:告警"}, + {"key": "0x100E", "datatype": "uint16", "remark": "出水压力传感器0:正常,1:告警"} ] } } \ No newline at end of file diff --git a/bin/Release/assets/config/registeraddrErr.json b/bin/Release/assets/config/registeraddrErr.json new file mode 100644 index 0000000..8a77108 --- /dev/null +++ b/bin/Release/assets/config/registeraddrErr.json @@ -0,0 +1,128 @@ +{ + "103":{ + "addr":[ + {"key": "0x1009", "datatype": "uint16", "remark": "EPO急停1故障,0正常"}, + {"key": "0x100A", "datatype": "uint16", "remark": "防雷器异常1告警,0正常"}, + {"key": "0x100B", "datatype": "uint16", "remark": "负载电压反序1故障,0正常"}, + {"key": "0x100C", "datatype": "uint16", "remark": "市电电压反序1故障,0正常"}, + {"key": "0x100D", "datatype": "uint16", "remark": "输出相反序1故障,0正常"}, + {"key": "0x100E", "datatype": "uint16", "remark": "过载告警1告警,0正常"}, + {"key": "0x100F", "datatype": "uint16", "remark": "过载超时1故障,0正常"}, + {"key": "0x1010", "datatype": "uint16", "remark": "交流过流保护1故障,0正常"}, + {"key": "0x1011", "datatype": "uint16", "remark": "逆变电压异常1故障,0正常"}, + {"key": "0x1012", "datatype": "uint16", "remark": "内部串口异常1故障,0正常"}, + {"key": "0x1013", "datatype": "uint16", "remark": "485通信故障1故障,0正常"}, + {"key": "0x1014", "datatype": "uint16", "remark": "CAN通信故障1故障,0正常"}, + {"key": "0x1015", "datatype": "uint16", "remark": "E2PROM故障1故障,0正常"}, + {"key": "0x1016", "datatype": "uint16", "remark": "电网过压1故障,0正常"}, + {"key": "0x1017", "datatype": "uint16", "remark": "电网欠压1故障,0正常"}, + {"key": "0x1018", "datatype": "uint16", "remark": "电网过频1故障,0正常"}, + {"key": "0x1019", "datatype": "uint16", "remark": "电网欠频1故障,0正常"}, + {"key": "0x101A", "datatype": "uint16", "remark": "电网快检综合异常1故障,0正常"}, + {"key": "0x101B", "datatype": "uint16", "remark": "电网幅值快检异常1故障,0正常"}, + {"key": "0x101C", "datatype": "uint16", "remark": "电网拖尾异常1故障,0正常"}, + {"key": "0x101E", "datatype": "uint16", "remark": "急停按钮信号NC1急停,0正常"}, + {"key": "0x101F", "datatype": "uint16", "remark": "避雷器NC1故障,0正常"}, + {"key": "0x1020", "datatype": "uint16", "remark": "避雷器断路器NC1故障,0正常"}, + {"key": "0x102F", "datatype": "uint16", "remark": "PCS_01下发设置1故障,0正常"}, + {"key": "0x1030", "datatype": "uint16", "remark": "PCS_02下发设置1故障,0正常"}, + {"key": "0x1031", "datatype": "uint16", "remark": "PCS_03下发设置1故障,0正常"}, + {"key": "0x1032", "datatype": "uint16", "remark": "PCS_04下发设置1故障,0正常"}, + {"key": "0x1033", "datatype": "uint16", "remark": "PCS_05下发设置1故障,0正常"}, + {"key": "0x1034", "datatype": "uint16", "remark": "PCS_06下发设置1故障,0正常"}, + {"key": "0x1035", "datatype": "uint16", "remark": "PCS_07下发设置1故障,0正常"}, + {"key": "0x1036", "datatype": "uint16", "remark": "PCS_08下发设置1故障,0正常"}, + {"key": "0x1037", "datatype": "uint16", "remark": "PCS_09下发设置1故障,0正常"}, + {"key": "0x1038", "datatype": "uint16", "remark": "PCS_10下发设置1:故障,0正常"}, + {"key": "0x1039", "datatype": "uint16", "remark": "内部DSP通信故障1:故障,0正常"}, + {"key": "0x103A", "datatype": "uint16", "remark": "BMS CAN通信故障1:故障,0正常"} + ] + }, + "104":{ + "addr":[ + {"key": "0x1010", "datatype": "uint16", "remark": "绝缘故障1:故障,0正常"}, + {"key": "0x1011", "datatype": "uint16", "remark": "漏电保护1:故障,0正常"}, + {"key": "0x1012", "datatype": "uint16", "remark": "直流过压1:故障,0正常"}, + {"key": "0x1013", "datatype": "uint16", "remark": "市电幅值异常1:故障,0正常"}, + {"key": "0x1014", "datatype": "uint16", "remark": "市电相序异常1:故障,0正常"}, + {"key": "0x1015", "datatype": "uint16", "remark": "温度开关异常1:故障,0正常"}, + {"key": "0x1016", "datatype": "uint16", "remark": "市电频率异常1:故障,0正常"}, + {"key": "0x1017", "datatype": "uint16", "remark": "IGBT过温1:故障,0正常"}, + {"key": "0x1018", "datatype": "uint16", "remark": "交流接地故障1:故障,0正常"}, + {"key": "0x1019", "datatype": "uint16", "remark": "逆变过流异常1:故障,0正常"}, + {"key": "0x101A", "datatype": "uint16", "remark": "直流缓起故障1:故障,0正常"}, + {"key": "0x101B", "datatype": "uint16", "remark": "直流主继电器故障1:故障,0正常"}, + {"key": "0x101C", "datatype": "uint16", "remark": "风机异常1:故障,0正常"}, + {"key": "0x101D", "datatype": "uint16", "remark": "主接触器异常1:故障,0正常"}, + {"key": "0x101E", "datatype": "uint16", "remark": "均浮充切换超时1:故障,0正常"}, + {"key": "0x101F", "datatype": "uint16", "remark": "硬件故障1:故障,0正常"}, + {"key": "0x1020", "datatype": "uint16", "remark": "机内过温1:故障,0正常"}, + {"key": "0x1021", "datatype": "uint16", "remark": "软启动故障1:故障,0正常"}, + {"key": "0x1022", "datatype": "uint16", "remark": "触摸屏通讯故障1:故障,0正常"}, + {"key": "0x1023", "datatype": "uint16", "remark": "防雷器故障1:故障,0正常"}, + {"key": "0x1024", "datatype": "uint16", "remark": "急停故障1:故障,0正常"}, + {"key": "0x1025", "datatype": "uint16", "remark": "BMS系统故障1:故障,0正常"}, + {"key": "0x1026", "datatype": "uint16", "remark": "BMS通讯故障1:故障,0正常"}, + {"key": "0x1027", "datatype": "uint16", "remark": "BMS干接点通讯故障1:故障,0正常"}, + {"key": "0x1028", "datatype": "uint16", "remark": "远程通讯故障1:故障,0正常"}, + {"key": "0x1029", "datatype": "uint16", "remark": "门禁告警1:故障,0正常"}, + {"key": "0x102A", "datatype": "uint16", "remark": "锁相异常1:故障,0正常"}, + {"key": "0x102B", "datatype": "uint16", "remark": "IGBT过温告警1:故障,0正常"}, + {"key": "0x102C", "datatype": "uint16", "remark": "硬件过流保护1:故障,0正常"}, + {"key": "0x102D", "datatype": "uint16", "remark": "驱动故障1:故障,0正常"}, + {"key": "0x102E", "datatype": "uint16", "remark": "ID冲突1:故障,0正常"}, + {"key": "0x102F", "datatype": "uint16", "remark": "电池过压1:故障,0正常"}, + {"key": "0x1030", "datatype": "uint16", "remark": "电池欠压1:故障,0正常"}, + {"key": "0x1031", "datatype": "uint16", "remark": "直流过流保护1:故障,0正常"}, + {"key": "0x1032", "datatype": "uint16", "remark": "输出电压异常1:故障,0正常"}, + {"key": "0x1033", "datatype": "uint16", "remark": "离网输出电压不符合1:故障,0正常"}, + {"key": "0x1034", "datatype": "uint16", "remark": "输出过载保护1:故障,0正常"}, + {"key": "0x1035", "datatype": "uint16", "remark": "输出短路保护1:故障,0正常"}, + {"key": "0x1036", "datatype": "uint16", "remark": "并机通信异常1:故障,0正常"}, + {"key": "0x1037", "datatype": "uint16", "remark": "电池保险异常1:故障,0正常"}, + {"key": "0x1038", "datatype": "uint16", "remark": "电池重载低压1:故障,0正常"}, + {"key": "0x1039", "datatype": "uint16", "remark": "电池低压告警1:故障,0正常"}, + {"key": "0x103A", "datatype": "uint16", "remark": "一拖二压差过大1:故障,0正常"}, + {"key": "0x103B", "datatype": "uint16", "remark": "电池反接故障1:故障,0正常"}, + {"key": "0x103C", "datatype": "uint16", "remark": "电池电压异常1:故障,0正常"}, + {"key": "0x103D", "datatype": "uint16", "remark": "过载告警1:故障,0正常"}, + {"key": "0x103E", "datatype": "uint16", "remark": "外部接触器异常1:故障,0正常"}, + {"key": "0x103F", "datatype": "uint16", "remark": "IGBT温度传感器异常1:故障,0正常"}, + {"key": "0x1040", "datatype": "uint16", "remark": "整机温度传感器异常1:故障,0正常"}, + {"key": "0x1041", "datatype": "uint16", "remark": "市电CT异常1:故障,0正常"}, + {"key": "0x1042", "datatype": "uint16", "remark": "逆变电流三相不平衡1:故障,0正常"}, + {"key": "0x1043", "datatype": "uint16", "remark": "逆变电流直流分量异常1:故障,0正常"}, + {"key": "0x1044", "datatype": "uint16", "remark": "母线不平衡1:故障,0正常"}, + {"key": "0x1045", "datatype": "uint16", "remark": "逆变电压直流分量异常1:故障,0正常"}, + {"key": "0x1046", "datatype": "uint16", "remark": "主接触器控制异常1:故障,0正常"}, + {"key": "0x1047", "datatype": "uint16", "remark": "逆变电压控制异常1:故障,0正常"}, + {"key": "0x1048", "datatype": "uint16", "remark": "直流霍尔异常1:故障,0正常"}, + {"key": "0x1049", "datatype": "uint16", "remark": "电池单体过压1:故障,0正常"}, + {"key": "0x104A", "datatype": "uint16", "remark": "电池单体欠压1:故障,0正常"}, + {"key": "0x104B", "datatype": "uint16", "remark": "电网过压1:故障,0正常"}, + {"key": "0x104C", "datatype": "uint16", "remark": "电网欠压1:故障,0正常"}, + {"key": "0x104D", "datatype": "uint16", "remark": "电网过频1:故障,0正常"}, + {"key": "0x104E", "datatype": "uint16", "remark": "电网欠频1:故障,0正常"}, + {"key": "0x104F", "datatype": "uint16", "remark": "市电不平衡1:故障,0正常"}, + {"key": "0x1050", "datatype": "uint16", "remark": "参数设置不匹配1:故障,0正常"}, + {"key": "0x1051", "datatype": "uint16", "remark": "SPI通信异常1:故障,0正常"}, + {"key": "0x1052", "datatype": "uint16", "remark": "SCI通信异常1:故障,0正常"}, + {"key": "0x1053", "datatype": "uint16", "remark": "IIC通信异常1:故障,0正常"}, + {"key": "0x1054", "datatype": "uint16", "remark": "Xintf通信异常1:故障,0正常"}, + {"key": "0x1055", "datatype": "uint16", "remark": "零偏校准异常1:故障,0正常"}, + {"key": "0x1056", "datatype": "uint16", "remark": "烟雾告警1:故障,0正常"}, + {"key": "0x1057", "datatype": "uint16", "remark": "无电池组故障1异常,0正常"}, + {"key": "0x1058", "datatype": "uint16", "remark": "环温降频1异常,0正常"}, + {"key": "0x1059", "datatype": "uint16", "remark": "交流过载1异常,0正常"}, + {"key": "0x105A", "datatype": "uint16", "remark": "采样异常1异常,0正常"}, + {"key": "0x105B", "datatype": "uint16", "remark": "24V辅源故障1异常,0正常"}, + {"key": "0x105C", "datatype": "uint16", "remark": "直流欠压异常1异常,0正常"}, + {"key": "0x105D", "datatype": "uint16", "remark": "散热器过温1异常,0正常"}, + {"key": "0x105E", "datatype": "uint16", "remark": "CAN配置故障1异常,0正常"}, + {"key": "0x105F", "datatype": "uint16", "remark": "3.3V辅源故障1异常,0正常"}, + {"key": "0x1060", "datatype": "uint16", "remark": "环境过温1异常,0正常"}, + {"key": "0x1061", "datatype": "uint16", "remark": "A相IGBT逆变过流1异常,0正常"}, + {"key": "0x1062", "datatype": "uint16", "remark": "B相IGBT逆变过流1异常,0正常"} + ] + } +} \ No newline at end of file diff --git a/bin/Release/assets/config/registeraddrs.bak.py b/bin/Release/assets/config/registeraddrs.bak.py new file mode 100644 index 0000000..53eebb2 --- /dev/null +++ b/bin/Release/assets/config/registeraddrs.bak.py @@ -0,0 +1,77 @@ +import re +import json + +def parse_datatype(text): + datatypes = ["int16", "uint16", "int32", "uint32", "int64", "uint64"] + for index, datatype in enumerate(datatypes): + left, separator, right = text.partition(datatype) + if len(separator) != 0: + return datatype, left + right + return "", text + + +def parse_from_file(filename): + data = "" + with open(filename, "r", encoding='utf-8') as f: # 打开文件 + linedata = "" + for line in f: # 行遍历 + line = line.strip() + #linedata = f.readline() # 读取文件的一行 + flag = bool(re.search(r'0x[0-9A-Fa-f]{4}', line)) + linedata += line.strip() + if flag: + # print(linedata) + # left, separator, right = linedata.partition("0x") + parts = re.split(r'(0x[0-9A-Fa-f]{4})', linedata) + linedata = "" + + key = parts[1] + datatype, remark = parse_datatype(parts[0].strip()) + remark = remark.replace("\t", " ").replace("\"", "") + + item = {} + item["key"] = key + item["datatype"] = datatype + item["remark"] = remark + + if len(data) > 0: + data += ",\n" + data += ("\t\t\t" + json.dumps(item, ensure_ascii=False)) + return data + + +addritems = {} +addritems["EMS_YT"] = ["EMS遥调.txt", 1] +addritems["BCU_YX"] = ["BCU电池簇遥信.txt", 1] +addritems["BCU_YC"] = ["BCU电池簇遥测.txt", 1] +addritems["BMS_YC"] = ["BMS电池堆遥测.txt", 1] +addritems["EMS_YX"] = ["EMS遥信.txt", 1] +addritems["EMS_YC"] = ["EMS遥测.txt", 1] +addritems["EMS_YT"] = ["EMS遥调.txt", 1] +addritems["PCS_YX"] = ["PCS遥信.txt", 1] +addritems["PCS_YC"] = ["PCS遥测.txt", 1] +addritems["PCU_YX"] = ["PCU遥信.txt", 1] +addritems["PCU_YC"] = ["PCU遥测.txt", 1] +addritems["MEM_YC"] = ["多功能电表遥测.txt", 1] +addritems["TH_YC"] = ["温湿度状态遥测.txt", 1] +addritems["Fire40_YX"] = ["消防4.0遥信.txt", 1] +addritems["Cooling_YX"] = ["冷机遥信.txt", 1] +addritems["Cooling_YC"] = ["冷机遥测.txt", 1] + + +with open('registeraddr.json', 'w', encoding='utf-8') as f: + f.write("{") + index = 0 + for key in addritems: + filename = addritems[key][0] + count = addritems[key][1] + print("parse: ", key, filename) + data = parse_from_file(filename) + if len(data) > 0: + data = "\n" + data + "\n\t" + if index != 0: + f.write(",") + f.write("\n\t\"" + key + "\": {\n\t\t\"count\":" + str(count) + ",\n\t\t\"addr\":[" + data + "\t]\n\t}") + index+=1 + f.write("\n}") + diff --git a/bin/Release/assets/config/registeraddrs.py b/bin/Release/assets/config/registeraddrs.py index 53eebb2..d6f7043 100644 --- a/bin/Release/assets/config/registeraddrs.py +++ b/bin/Release/assets/config/registeraddrs.py @@ -1,77 +1,89 @@ -import re -import json +from openpyxl import load_workbook -def parse_datatype(text): - datatypes = ["int16", "uint16", "int32", "uint32", "int64", "uint64"] - for index, datatype in enumerate(datatypes): - left, separator, right = text.partition(datatype) - if len(separator) != 0: - return datatype, left + right - return "", text +def read_cell(sheet, row, col): + val = str(sheet.cell(row, col).value) + if val == "None": + val = "" + return val.strip() +def read_sheet(wb, topic, sht_name): + sheet = wb[sht_name] + + text = "" + for i in range(1, sheet.max_row): + # print(str(sheet.cell(i, 1).value)) + addr = read_cell(sheet, i, 8) + name = read_cell(sheet,i, 2) + datatype = read_cell(sheet,i, 4) + unit = read_cell(sheet, i, 5) + remark = read_cell(sheet, i, 6) + remark = name + remark + + if (len(addr) == 6): + if (len(unit)>0): + remark += '(' + unit + ')' + if (len(text)>0): + text += ',\n' + text += '\t\t\t{"key": "%s", "datatype": "%s", "remark": "%s"}' % (addr, datatype, remark.replace("\n", "")) + -def parse_from_file(filename): - data = "" - with open(filename, "r", encoding='utf-8') as f: # 打开文件 - linedata = "" - for line in f: # 行遍历 - line = line.strip() - #linedata = f.readline() # 读取文件的一行 - flag = bool(re.search(r'0x[0-9A-Fa-f]{4}', line)) - linedata += line.strip() - if flag: - # print(linedata) - # left, separator, right = linedata.partition("0x") - parts = re.split(r'(0x[0-9A-Fa-f]{4})', linedata) - linedata = "" + if (len(text)>0): + text = "\n" + text + "\n\t\t" + text = '\t"%s":{\n\t\t"addr":[%s]\n\t}' % (topic, text) + return text + - key = parts[1] - datatype, remark = parse_datatype(parts[0].strip()) - remark = remark.replace("\t", " ").replace("\"", "") - - item = {} - item["key"] = key - item["datatype"] = datatype - item["remark"] = remark - - if len(data) > 0: - data += ",\n" - data += ("\t\t\t" + json.dumps(item, ensure_ascii=False)) - return data - - -addritems = {} -addritems["EMS_YT"] = ["EMS遥调.txt", 1] -addritems["BCU_YX"] = ["BCU电池簇遥信.txt", 1] -addritems["BCU_YC"] = ["BCU电池簇遥测.txt", 1] -addritems["BMS_YC"] = ["BMS电池堆遥测.txt", 1] -addritems["EMS_YX"] = ["EMS遥信.txt", 1] -addritems["EMS_YC"] = ["EMS遥测.txt", 1] -addritems["EMS_YT"] = ["EMS遥调.txt", 1] -addritems["PCS_YX"] = ["PCS遥信.txt", 1] -addritems["PCS_YC"] = ["PCS遥测.txt", 1] -addritems["PCU_YX"] = ["PCU遥信.txt", 1] -addritems["PCU_YC"] = ["PCU遥测.txt", 1] -addritems["MEM_YC"] = ["多功能电表遥测.txt", 1] -addritems["TH_YC"] = ["温湿度状态遥测.txt", 1] -addritems["Fire40_YX"] = ["消防4.0遥信.txt", 1] -addritems["Cooling_YX"] = ["冷机遥信.txt", 1] -addritems["Cooling_YC"] = ["冷机遥测.txt", 1] +wb = load_workbook('EMU对外通信点表最终修改1版_v9.xlsx', data_only=True) +text = "" +text = read_sheet(wb, "EMS_YT", "EMS遥调") +text += ',\n' + read_sheet(wb, "EMS_YX", "EMS遥信") +text += ',\n' + read_sheet(wb, "EMS_YC", "EMS遥测") +text += ',\n' + read_sheet(wb, "PCU_YC", "PCU遥测") +text += ',\n' + read_sheet(wb, "PCU_YX", "PCU遥信") +text += ',\n' + read_sheet(wb, "PCS_YC", "PCS遥测") +text += ',\n' + read_sheet(wb, "PCS_YX", "PCS遥信") +text += ',\n' + read_sheet(wb, "BMS_YC", "BMS电池堆遥测") +text += ',\n' + read_sheet(wb, "BCU_YC", "BCU电池簇遥测") +text += ',\n' + read_sheet(wb, "BCU_YX", "BCU电池簇遥信") +# text += ',\n' + read_sheet(wb, "AirC_YC", "空调遥测") +# text += ',\n' + read_sheet(wb, "AirC_YX", "空调遥信") +text += ',\n' + read_sheet(wb, "MEM_YC", "多功能电表遥测") +text += ',\n' + read_sheet(wb, "TH_YC", "温湿度状态遥测") +text += ',\n' + read_sheet(wb, "Fire40_YX", "消防4.0遥信") +text += ',\n' + read_sheet(wb, "Cooling_YC", "冷机遥测") +text += ',\n' + read_sheet(wb, "Cooling_YX", "冷机遥信") with open('registeraddr.json', 'w', encoding='utf-8') as f: - f.write("{") - index = 0 - for key in addritems: - filename = addritems[key][0] - count = addritems[key][1] - print("parse: ", key, filename) - data = parse_from_file(filename) - if len(data) > 0: - data = "\n" + data + "\n\t" - if index != 0: - f.write(",") - f.write("\n\t\"" + key + "\": {\n\t\t\"count\":" + str(count) + ",\n\t\t\"addr\":[" + data + "\t]\n\t}") - index+=1 - f.write("\n}") + f.write("{\n" + text + "\n}") + +def read_sheet_alarm(wb, device_type, sht_name): + sheet = wb[sht_name] + text = "" + for i in range(1, sheet.max_row): + addr = read_cell(sheet, i, 8) + is_alarm = (read_cell(sheet, i, 7) == "告警") + + if (len(addr) == 6 and is_alarm) : + name = read_cell(sheet,i, 2) + datatype = read_cell(sheet,i, 4) + unit = read_cell(sheet, i, 5) + remark = read_cell(sheet, i, 6) + remark = name + remark + + if (len(unit)>0): + remark += '(' + unit + ')' + if (len(text)>0): + text += ',\n' + text += '\t\t\t{"key": "%s", "datatype": "%s", "remark": "%s"}' % (addr, datatype, remark.replace("\n", "")) + if (len(text)>0): + text = "\n" + text + "\n\t\t" + text = '\t"%s":{\n\t\t"addr":[%s]\n\t}' % (device_type, text) + return text; + +text_err = "" +text_err = read_sheet_alarm(wb, 103, "PCU遥信") +text_err += ',\n' + read_sheet_alarm(wb, 104, "PCS遥信") +with open('registeraddrErr.json', 'w', encoding='utf-8') as f: + f.write("{\n" + text_err + "\n}") diff --git a/bin/Release/assets/config/告警/PCS.txt b/bin/Release/assets/config/告警/PCS.txt new file mode 100644 index 0000000..0f1ce18 --- /dev/null +++ b/bin/Release/assets/config/告警/PCS.txt @@ -0,0 +1,84 @@ +0x100F 绝缘故障 1:故障,0正常 +0x1010 漏电保护 1:故障,0正常 +0x1011 直流过压 1:故障,0正常 +0x1012 市电幅值异常 1:故障,0正常 +0x1013 市电相序异常 1:故障,0正常 +0x1014 温度开关异常 1:故障,0正常 +0x1015 市电频率异常 1:故障,0正常 +0x1016 IGBT过温 1:故障,0正常 +0x1017 交流接地故障 1:故障,0正常 +0x1018 逆变过流异常 1:故障,0正常 +0x1019 直流缓起故障 1:故障,0正常 +0x101A 直流主继电器故障 1:故障,0正常 +0x101B 风机异常 1:故障,0正常 +0x101C 主接触器异常 1:故障,0正常 +0x101D 均浮充切换超时 1:故障,0正常 +0x101E 硬件故障 1:故障,0正常 +0x101F 机内过温 1:故障,0正常 +0x1020 软启动故障 1:故障,0正常 +0x1021 触摸屏通讯故障 1:故障,0正常 +0x1022 防雷器故障 1:故障,0正常 +0x1023 急停故障 1:故障,0正常 +0x1024 BMS系统故障 1:故障,0正常 +0x1025 BMS通讯故障 1:故障,0正常 +0x1026 BMS干接点通讯故障 1:故障,0正常 +0x1027 远程通讯故障 1:故障,0正常 +0x1028 门禁告警 1:故障,0正常 +0x1029 锁相异常 1:故障,0正常 +0x102A IGBT过温告警 1:故障,0正常 +0x102B 硬件过流保护 1:故障,0正常 +0x102C 驱动故障 1:故障,0正常 +0x102D ID冲突 1:故障,0正常 +0x102E 电池过压 1:故障,0正常 +0x102F 电池欠压 1:故障,0正常 +0x1030 直流过流保护 1:故障,0正常 +0x1031 输出电压异常 1:故障,0正常 +0x1032 离网输出电压不符合 1:故障,0正常 +0x1033 输出过载保护 1:故障,0正常 +0x1034 输出短路保护 1:故障,0正常 +0x1035 并机通信异常 1:故障,0正常 +0x1036 电池保险异常 1:故障,0正常 +0x1037 电池重载低压 1:故障,0正常 +0x1038 电池低压告警 1:故障,0正常 +0x1039 一拖二压差过大 1:故障,0正常 +0x103A 电池反接故障 1:故障,0正常 +0x103B 电池电压异常 1:故障,0正常 +0x103C 过载告警 1:故障,0正常 +0x103D 外部接触器异常 1:故障,0正常 +0x103E IGBT温度传感器异常 1:故障,0正常 +0x103F 整机温度传感器异常 1:故障,0正常 +0x1040 市电CT异常 1:故障,0正常 +0x1041 逆变电流三相不平衡 1:故障,0正常 +0x1042 逆变电流直流分量异常 1:故障,0正常 +0x1043 母线不平衡 1:故障,0正常 +0x1044 逆变电压直流分量异常 1:故障,0正常 +0x1045 主接触器控制异常 1:故障,0正常 +0x1046 逆变电压控制异常 1:故障,0正常 +0x1047 直流霍尔异常 1:故障,0正常 +0x1048 电池单体过压 1:故障,0正常 +0x1049 电池单体欠压 1:故障,0正常 +0x104A 电网过压 1:故障,0正常 +0x104B 电网欠压 1:故障,0正常 +0x104C 电网过频 1:故障,0正常 +0x104D 电网欠频 1:故障,0正常 +0x104E 市电不平衡 1:故障,0正常 +0x104F 参数设置不匹配 1:故障,0正常 +0x1050 SPI通信异常 1:故障,0正常 +0x1051 SCI通信异常 1:故障,0正常 +0x1052 IIC通信异常 1:故障,0正常 +0x1053 Xintf通信异常 1:故障,0正常 +0x1054 零偏校准异常 1:故障,0正常 +0x1055 烟雾告警 1:故障,0正常 +0x1056 无电池组故障 1异常,0正常 +0x1057 环温降频 1异常,0正常 +0x1058 交流过载 1异常,0正常 +0x1059 采样异常 1异常,0正常 +0x105A 24V辅源故障 1异常,0正常 +0x105B 直流欠压异常 1异常,0正常 +0x105C 散热器过温 1异常,0正常 +0x105D CAN配置故障 1异常,0正常 +0x105E 3.3V辅源故障 1异常,0正常 +0x105F 环境过温 1异常,0正常 +0x1060 A相IGBT逆变过流 1异常,0正常 +0x1061 B相IGBT逆变过流 1异常,0正常 +0x1062 C相IGBT逆变过流 1异常,0正常 \ No newline at end of file diff --git a/bin/Release/assets/config/电表-告警.xlsx b/bin/Release/assets/config/电表-告警.xlsx new file mode 100644 index 0000000..04e8659 Binary files /dev/null and b/bin/Release/assets/config/电表-告警.xlsx differ diff --git a/bin/Release/assets/config/BCU电池簇遥信.txt b/bin/Release/assets/config/电表/BCU电池簇遥信.txt similarity index 100% rename from bin/Release/assets/config/BCU电池簇遥信.txt rename to bin/Release/assets/config/电表/BCU电池簇遥信.txt diff --git a/bin/Release/assets/config/BCU电池簇遥测.txt b/bin/Release/assets/config/电表/BCU电池簇遥测.txt similarity index 100% rename from bin/Release/assets/config/BCU电池簇遥测.txt rename to bin/Release/assets/config/电表/BCU电池簇遥测.txt diff --git a/bin/Release/assets/config/BMS电池堆遥测.txt b/bin/Release/assets/config/电表/BMS电池堆遥测.txt similarity index 100% rename from bin/Release/assets/config/BMS电池堆遥测.txt rename to bin/Release/assets/config/电表/BMS电池堆遥测.txt diff --git a/bin/Release/assets/config/EMS遥信.txt b/bin/Release/assets/config/电表/EMS遥信.txt similarity index 100% rename from bin/Release/assets/config/EMS遥信.txt rename to bin/Release/assets/config/电表/EMS遥信.txt diff --git a/bin/Release/assets/config/EMS遥测.txt b/bin/Release/assets/config/电表/EMS遥测.txt similarity index 100% rename from bin/Release/assets/config/EMS遥测.txt rename to bin/Release/assets/config/电表/EMS遥测.txt diff --git a/bin/Release/assets/config/EMS遥调.txt b/bin/Release/assets/config/电表/EMS遥调.txt similarity index 100% rename from bin/Release/assets/config/EMS遥调.txt rename to bin/Release/assets/config/电表/EMS遥调.txt diff --git a/bin/Release/assets/config/PCS遥信.txt b/bin/Release/assets/config/电表/PCS遥信.txt similarity index 100% rename from bin/Release/assets/config/PCS遥信.txt rename to bin/Release/assets/config/电表/PCS遥信.txt diff --git a/bin/Release/assets/config/PCS遥测.txt b/bin/Release/assets/config/电表/PCS遥测.txt similarity index 100% rename from bin/Release/assets/config/PCS遥测.txt rename to bin/Release/assets/config/电表/PCS遥测.txt diff --git a/bin/Release/assets/config/PCU遥信.txt b/bin/Release/assets/config/电表/PCU遥信.txt similarity index 100% rename from bin/Release/assets/config/PCU遥信.txt rename to bin/Release/assets/config/电表/PCU遥信.txt diff --git a/bin/Release/assets/config/PCU遥测.txt b/bin/Release/assets/config/电表/PCU遥测.txt similarity index 100% rename from bin/Release/assets/config/PCU遥测.txt rename to bin/Release/assets/config/电表/PCU遥测.txt diff --git a/bin/Release/assets/config/冷机遥信.txt b/bin/Release/assets/config/电表/冷机遥信.txt similarity index 100% rename from bin/Release/assets/config/冷机遥信.txt rename to bin/Release/assets/config/电表/冷机遥信.txt diff --git a/bin/Release/assets/config/冷机遥测.txt b/bin/Release/assets/config/电表/冷机遥测.txt similarity index 100% rename from bin/Release/assets/config/冷机遥测.txt rename to bin/Release/assets/config/电表/冷机遥测.txt diff --git a/bin/Release/assets/config/多功能电表遥测.txt b/bin/Release/assets/config/电表/多功能电表遥测.txt similarity index 100% rename from bin/Release/assets/config/多功能电表遥测.txt rename to bin/Release/assets/config/电表/多功能电表遥测.txt diff --git a/bin/Release/assets/config/消防4.0遥信.txt b/bin/Release/assets/config/电表/消防4.0遥信.txt similarity index 100% rename from bin/Release/assets/config/消防4.0遥信.txt rename to bin/Release/assets/config/电表/消防4.0遥信.txt diff --git a/bin/Release/assets/config/温湿度状态遥测.txt b/bin/Release/assets/config/电表/温湿度状态遥测.txt similarity index 100% rename from bin/Release/assets/config/温湿度状态遥测.txt rename to bin/Release/assets/config/电表/温湿度状态遥测.txt diff --git a/bin/Release/assets/config/空调遥信.txt b/bin/Release/assets/config/电表/空调遥信.txt similarity index 100% rename from bin/Release/assets/config/空调遥信.txt rename to bin/Release/assets/config/电表/空调遥信.txt diff --git a/bin/Release/assets/config/空调遥测.txt b/bin/Release/assets/config/电表/空调遥测.txt similarity index 100% rename from bin/Release/assets/config/空调遥测.txt rename to bin/Release/assets/config/电表/空调遥测.txt diff --git a/bin/Release/assets/ui/iconFullscreen.png b/bin/Release/assets/ui/iconFullscreen.png new file mode 100644 index 0000000..10bf560 Binary files /dev/null and b/bin/Release/assets/ui/iconFullscreen.png differ diff --git a/bin/Release/assets/ui/iconFullscreenExit.png b/bin/Release/assets/ui/iconFullscreenExit.png new file mode 100644 index 0000000..d418dbc Binary files /dev/null and b/bin/Release/assets/ui/iconFullscreenExit.png differ diff --git a/src/app/AppData.cpp b/src/app/AppData.cpp index 48b2dea..6e3d922 100644 --- a/src/app/AppData.cpp +++ b/src/app/AppData.cpp @@ -33,13 +33,13 @@ std::string ElectPeriod::dump() } -void AppData::initFromDB() +bool AppData::initFromDB() { auto dao = DaoEntity::create(""); if (!dao->isConnected()) { spdlog::error("Init app data failed, database connected error."); - return; + return false; } std::string str; @@ -106,7 +106,8 @@ void AppData::initFromDB() } { // 数据库读取场站信息 str = "", result.clear(); - DAO::queryStationList(dao, result); + std::string sql = "SELECT s.*, p.name policy_name, p.`type` policy_type, p.value FROM station s LEFT JOIN policy p ON s.policy_id=p.policy_id;"; + dao->exec(sql, result); for (auto& fields: result) { auto station = std::make_shared(); @@ -127,8 +128,7 @@ void AppData::initFromDB() auto station = this->getStation(stationId); if (station) { - auto device = Device::create(fields); - station->addDevice(deviceId, device); + station->addDevice(fields); } else { @@ -141,7 +141,7 @@ void AppData::initFromDB() DAO::queryPolicyList(dao, result); for (auto& fields: result) { - auto policy = std::make_shared(); + auto policy = std::make_shared(); policy->policyId = fields.get(DMPolicy::POLICY_ID); policy->type = fields.get(DMPolicy::TYPE); policy->name = fields.value(DMPolicy::NAME); @@ -236,28 +236,17 @@ void AppData::initFromDB() } } } + return true; } -void AppData::init() +bool AppData::init() { - this->initFromDB(); + bool ret = this->initFromDB(); + if (!ret) { return false; } - auto& optionMqtt = Config::option.mqtt; - if (!optionMqtt.host.empty()) - { - for (auto& item : mapStation) - { - auto& station = item.second; - - if (station->status == 1) - { - // "tcp://localhost:1883" - station->mqttCli->init(optionMqtt.host, station->code, optionMqtt.username, optionMqtt.password); - } - } - } this->launchDate = Config::option.lunchDate; + return true; } std::shared_ptr AppData::getStation(int stationId) diff --git a/src/app/AppData.h b/src/app/AppData.h index 6a61ef8..07a24f2 100644 --- a/src/app/AppData.h +++ b/src/app/AppData.h @@ -11,7 +11,7 @@ class Station; class Device; -class MyPolicy; +class SysPolicy; using VecPairSS = std::vector>; @@ -57,8 +57,8 @@ public: class AppData { public: - void init(); - void initFromDB(); + bool init(); + bool initFromDB(); // 读取统计数据: 今日统计数据,累计统计数据 void loadStatData(); @@ -155,7 +155,7 @@ public: std::unordered_map mapPolicyType; // 策略信息 - std::unordered_map> mapPolicy; + std::unordered_map> mapPolicy; // 电力峰谷分段 (12个月,每个月按小时分成24个时段) std::vector> vecElectPeriods; diff --git a/src/app/Application.cpp b/src/app/Application.cpp index bd80da1..43bbcd7 100644 --- a/src/app/Application.cpp +++ b/src/app/Application.cpp @@ -18,6 +18,8 @@ void Application::init() // MQTT 数据结构 MqttClient::loadDataStruct("assets/config/registeraddr.json"); + // 设备读取寄存器的地址定义 + Device::loadParamAddr("assets/config/monitoraddr.json"); // 设置数据库配置 DaoEntity::setOption(Config::option.database.host, @@ -34,7 +36,7 @@ void Application::init() // 连接数据库,读取基础信息 // 初始化系统基础数据 - appdata.init(); + this->isInit = appdata.init(); // 创建设备处理线程 std::thread([=]() { runThreadDevice(); }).detach(); @@ -47,11 +49,11 @@ void Application::init() } }).detach(); - // 创建主业务循环线程 - std::thread([=]() { runThreadMain(); }).detach(); - // 统计分析 std::thread([=]() { runThreadStat(); }).detach(); + + // 创建主业务循环线程 + std::thread([=]() { runThreadMain(); }).detach(); } @@ -71,37 +73,38 @@ void Application::runThreadMain() while (!isQuit) { - //// 连接场站 - //static TimeTick ttStation; - //if (ttStation.elapse(10000)) - //{ - // if (!mqttCli->isConnected) - // { - // } - // else - // { - // for (auto& item: appdata.mapStation) - // { - // auto station = item.second; - // if (station && !station->isConnected) - // { - // std::string stationCode = station->code; - // std::vector vecTopics = { - // "up/json" + stationCode + "/EMS_YX", - // "up/json" + stationCode + "/EMS_YC", - // "up/json" + stationCode + "/PCU_YX", - // "up/json" + stationCode + "/PCU_YC", - // }; - // mqttCli->subscribe(vecTopics, [=](int id) - // { - // station->isConnected = (id == 0); - // }); - // } - // break; - // } - // } - //} + if (!this->isInit) // 初始化失败 + { + std::this_thread::sleep_for(std::chrono::milliseconds(10000)); + this->isInit = appdata.init(); + if (!this->isInit) { continue; } + } + static TimeTick ttMqtt; + // 检查 场站的 MQTT 连接 + if (ttMqtt.elapse(10)) + { + auto& optionMqtt = Config::option.mqtt; + if (!optionMqtt.host.empty()) + { + for (auto& item : appdata.mapStation) + { + if (item.second) + { + item.second->initMqtt(); + //item.second->polling(); + } + } + } + } + + /////////////////////////////////////////////////////////////////////////////////////////// + /// 召测 + static TimeTick tt1; + if (tt1.elapse(10)) + { + + } std::this_thread::sleep_for(std::chrono::milliseconds(10)); } } @@ -131,6 +134,16 @@ void Application::runThreadStat() { //spdlog::info("保存历史数据倒计时: {}", 600 - offset); } + + + + + for (auto& station : appdata.mapStation) + { + + } + + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); } } \ No newline at end of file diff --git a/src/app/Application.h b/src/app/Application.h index 3832257..fd1177a 100644 --- a/src/app/Application.h +++ b/src/app/Application.h @@ -33,6 +33,7 @@ public: public: bool isQuit = false; + bool isInit = false; // 登录的管理员信息 Operator op; diff --git a/src/app/Device.cpp b/src/app/Device.cpp index ddb0f95..8c95cb2 100644 --- a/src/app/Device.cpp +++ b/src/app/Device.cpp @@ -7,6 +7,19 @@ #include +std::map> Device::s_mapDeviceParamAddr; + +static std::vector& GetDeviceParamAddrs(int deviceType) +{ + static std::vector vecAddrs = {}; + auto iter = Device::s_mapDeviceParamAddr.find(deviceType); + if (iter != Device::s_mapDeviceParamAddr.end()) + { + return iter->second; + } + return vecAddrs; +} + static std::unordered_set g_setCacheDeviceType = {3, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}; static bool CheckCacheType(int type) { @@ -16,30 +29,72 @@ static bool CheckCacheType(int type) std::shared_ptr Device::create(Fields& fields) { auto device = std::make_shared(); - device->deviceId = fields.get("device_id"); - device->type = fields.get("type"); - device->name = fields.value("name"); - device->code = fields.value("code"); - device->isOpen = fields.get("is_open"); - device->attrsJson = fields.value("attrs"); - device->category = fields.get("category"); + device->setFields(fields); + return device; +} + + +void Device::loadParamAddr(std::string filename) +{ + try + { + njson json; + if (!JSON::load(filename, json)) + { + spdlog::error("[device] json load param addr error, filename={}", filename); + } + for (auto& jsonitem : json.items()) + { + std::string key = jsonitem.key(); + auto& jsonnodeItem = jsonitem.value(); + spdlog::info(jsonnodeItem.dump()); + + int type = jsonnodeItem["deviceType"]; + auto& vec = s_mapDeviceParamAddr[type]; + for (auto& v : jsonnodeItem["addr_YC"]) + { + std::string name = JSON::get(v[0]); + std::string addr = JSON::get(v[1]); + std::string defaultVal = JSON::get(v[2]); + std::string unit = JSON::get(v[3]); + float ratio = Utils::toFloat(JSON::get(v[4])); + vec.push_back(DeviceParamAddr(name, addr, defaultVal, unit, ratio)); + } + } + } + catch (nlohmann::json::parse_error& e) + { + spdlog::error("[device] parse [{}] error: ", filename, e.what()); + } +} + +void Device::setFields(Fields& fields) +{ + fields.get("device_id", this->deviceId); + fields.get("type", this->type); + fields.get("name", this->name); + fields.get("code", this->code); + fields.get("is_open", this->isOpen); + fields.get("attrs", this->attrsJson); + fields.get("category", this->category); // 解析属性的JSON字符串,转换成键值对 njson jsonroot; - bool ret = JSON::parse(device->attrsJson, jsonroot); + bool ret = JSON::parse(this->attrsJson, jsonroot); if (!ret) // 解析错误 { - spdlog::error("[device] device attr json parse error, device_id={}", device->deviceId); + spdlog::error("[device] device attr json parse error, device_id={}", this->deviceId); } else { + this->attrs.clear(); for (auto& [key, val] : jsonroot.items()) { std::string valType = val.type_name(); if (valType == "string") { - device->attrs.set(key, val.get()); + this->attrs.set(key, val.get()); } else if (valType == "number") { - device->attrs.set(key, val.get()); + this->attrs.set(key, val.get()); } else { spdlog::error("[device] device attr unknown type: key={}, valtype={}", key, valType); @@ -47,22 +102,13 @@ std::shared_ptr Device::create(Fields& fields) } } - //int step = 600; - //for (int i = 0; i*600<86400; ++i) - //{ - // double voltage = double(Utils::random(20000, 30000))*0.01; - // double current = double(Utils::random(1000, 2000))*0.01; - // device->mapCacheVoltage[i*step] = voltage; - // device->mapCacheCurrent[i*step] = current; - // device->mapCachePower[i*step] = voltage * current; - //} - - // 启动通讯,该函数中会自动判断isOpen状态,选择是否进行通讯连接 - //device->startComm(); - return device; + auto& vecAddrs = GetDeviceParamAddrs(this->type); + for (auto& item: vecAddrs) + { + this->mapMyParams[item.addr] = &item; + } } - int Device::startComm() { if (!isOpen) @@ -182,42 +228,47 @@ void Device::storeDB(int npos) { } - - - - -void Device::setParam(std::string k, std::string v) +void Device::setParam(std::string k, int v) { - mapParams[k] = v; + float ratio = 1.0; + auto iter = mapMyParams.find(k); + if (iter != mapMyParams.end()) + { + ratio = iter->second->ratio; + spdlog::info("[device] set param: {} {}={}, ratio={}", iter->second->name, k, v, ratio); + } + + int precision = (ratio != 1.0f) ? 2 : 0; + mapParams[k] = Utils::toStr(v*ratio, precision); if (type == 3 ) // 电表 { - if (k == "") this->err = Utils::toInt(v); + if (k == "") this->err = v; } else if (type == 101) // EMS { } else if (type == 102) // PCS { - if (k == "0x1003") err = Utils::toInt(v); // 故障状态 R uint16 1故障,0正常 0 0x1003 - if (k == "0x1005") online = Utils::toInt(v); // 设备在线 R uint16 1在线,0无效 1 0x1005 - if (k == "0x1009") running = (v=="1" || v=="2"); //充放状态 R uint16 0:待机, 1:充电, 2:放电, 3:搁置 0 0x1009 + if (k == "0x1003") err = v; // 故障状态 R uint16 1故障,0正常 0 0x1003 + if (k == "0x1005") online = v; // 设备在线 R uint16 1在线,0无效 1 0x1005 + if (k == "0x1009") running = (v==1 || v==2); //充放状态 R uint16 0:待机, 1:充电, 2:放电, 3:搁置 0 0x1009 } else if (type == 103) // PCU { - if (k == "0x1002") err = Utils::toInt(v); //故障状态 R uint16 1故障,0正常 0 0x1002 - if (k == "0x1004") online = Utils::toInt(v); //设备在线 R uint16 1在线,0无效 1 0x1004 - if (k == "0x1006") running = Utils::toInt(v); //启停状态 R uint16 1开机,0关机 1 0x1006 + if (k == "0x1002") err = v; //故障状态 R uint16 1故障,0正常 0 0x1002 + if (k == "0x1004") online = v; //设备在线 R uint16 1在线,0无效 1 0x1004 + if (k == "0x1006") running = v; //启停状态 R uint16 1开机,0关机 1 0x1006 } else if (type == 104) // BMS { - if (k == "0x004A") { err = (v=="1"); online = 1; } //运行状态 R uint16 0 运行状态 0-正常 1-告警 2-保护 0x004A - if (k == "0x004B") running = (v=="1" || v=="2"); //充放电状态 R uint16 0 0-待机 1-充电 2-放电 0x004B + if (k == "0x004A") { err = (v==1); online = 1; } //运行状态 R uint16 0 运行状态 0-正常 1-告警 2-保护 0x004A + if (k == "0x004B") running = (v==1 || v==2); //充放电状态 R uint16 0 0-待机 1-充电 2-放电 0x004B } else if (type == 105) // BCU { - if (k == "0xA003") running = (v=="51" || v=="68"); //蓄电池充放电状态 R uint16 "0x11开路,0x22待机,0x33充电,0x44放电" 34 0xA003 - if (k == "0xA004") err = (v=="85"); online=1; //电池组运行状态 R uint16 "0x11跳机,0x22待机,0x33放空,0x44充满,0x55预警,0x66正常" 102 0xA004 + if (k == "0xA003") running = (v==0x33 || v==0x44); //蓄电池充放电状态 R uint16 "0x11开路,0x22待机,0x33充电,0x44放电" 34 0xA003 + if (k == "0xA004") err = (v==0x55); online=1; //电池组运行状态 R uint16 "0x11跳机,0x22待机,0x33放空,0x44充满,0x55预警,0x66正常" 102 0xA004 } else if (type == 106) // 充电桩 { @@ -237,7 +288,6 @@ std::string Device::getParam(std::string k, std::string defaultVal) return defaultVal; } - void Device::getRuntimeParams(std::vector>& params) { // 3 电表 @@ -248,71 +298,23 @@ void Device::getRuntimeParams(std::vector>& // 105 BCU // 106 充电桩 // 109 光伏板 - - - if (this->type == 3) + auto& vecAddr = s_mapDeviceParamAddr[this->type]; + for (auto& itemAddr: vecAddr) { - params.push_back({"A相电压", getParam("0x000B", "0.0") + " V"}); - params.push_back({"A相电流", getParam("0x000D", "0.0") + " A"}); - params.push_back({"B相电压", getParam("0x000F", "0.0") + " V"}); - params.push_back({"B相电流", getParam("0x0011", "0.0") + " A"}); - params.push_back({"C相电压", getParam("0x0013", "0.0") + " V"}); - params.push_back({"C相电流", getParam("0x0015", "0.0") + " A"}); - } - else if (this->type == 101) // EMS - { - params.push_back({"A相电压", getParam("0x107E", "0.0") + " V"}); - params.push_back({"A相电流", getParam("0x1084", "0.0") + " A"}); - params.push_back({"B相电压", getParam("0x1080", "0.0") + " V"}); - params.push_back({"B相电流", getParam("0x1086", "0.0") + " A"}); - params.push_back({"C相电压", getParam("0x1082", "0.0") + " V"}); - params.push_back({"C相电流", getParam("0x1088", "0.0") + " A"}); - } - else if (this->type == 102) // PCS - { - params.push_back({"A相电压", getParam("0x0010", "0.0") + " V"}); - params.push_back({"A相电流", getParam("0x0019", "0.0") + " A"}); - params.push_back({"B相电压", getParam("0x0011", "0.0") + " V"}); - params.push_back({"B相电流", getParam("0x001A", "0.0") + " A"}); - params.push_back({"C相电压", getParam("0x0011", "0.0") + " V"}); - params.push_back({"C相电流", getParam("0x001B", "0.0") + " A"}); - } - else if (this->type == 103) // PCU - { - params.push_back({"A相电压", getParam("0x0013", "0.0") + " V"}); - params.push_back({"A相电流", getParam("0x001C", "0.0") + " A"}); - params.push_back({"B相电压", getParam("0x0014", "0.0") + " V"}); - params.push_back({"B相电流", getParam("0x001D", "0.0") + " A"}); - params.push_back({"C相电压", getParam("0x0015", "0.0") + " V"}); - params.push_back({"C相电流", getParam("0x001E", "0.0") + " A"}); - } - else if (this->type == 104) // BMS - { - params.push_back({"SOC", getParam("0x0001", "0") + " %"}); - params.push_back({"SOH", getParam("0x0002", "0") + " %"}); - params.push_back({"电压", getParam("0x0003", "0.0") + " V"}); - params.push_back({"电流", getParam("0x0005", "0.0") + " A"}); - params.push_back({"单体最大电压", getParam("0x0021", "0.0") + " V"}); - params.push_back({"单体最小电压", getParam("0x0024", "0.0") + " V"}); - params.push_back({"单体最大温度", getParam("0x0029", "0.0") + " ℃"}); - params.push_back({"单体最小温度", getParam("0x002C", "0.0") + " ℃"}); - } - else if (this->type == 105) // BCU - { - params.push_back({"簇电压", getParam("0x0003", "0.0") + " V"}); - params.push_back({"簇电流", getParam("0x0005", "0") + " A"}); - params.push_back({"簇温度", getParam("0x0007", "0.0") + " ℃"}); - params.push_back({"簇电阻", getParam("0x0009", "0.0") + " Ω"}); - params.push_back({"簇SOC", getParam("0x000B", "0") + " %"}); - params.push_back({"簇SOH", getParam("0x000C", "0") + " %"}); - } - else - { - params.push_back({"额定电压", getParam("0x0001", "0.0") + " V"}); - params.push_back({"实时电压", getParam("0x0001", "0.0") + " V"}); - params.push_back({"额定电流", getParam("0x0001", "0.0") + " A"}); - params.push_back({"实时电流", getParam("0x0001", "0.0") + " A"}); - params.push_back({"额定功率", getParam("0x0001", "0.0") + " W"}); - params.push_back({"实时功率", getParam("0x0001", "0.0") + " W"}); + params.push_back({itemAddr.name, getParam(itemAddr.addr, itemAddr.defaultVal) + itemAddr.unit}); + } +} + +void Device::getRuntimeParams1(std::vector>& params) +{ + if (type == 106) + { + params.push_back({"需求电压", getParam("31072", "0.0") + " V"}); + params.push_back({"需求电流", getParam("31074", "0.0") + " A"}); + params.push_back({"需求功率", getParam("31076", "0.0") + " kW"}); + params.push_back({"功率限值", getParam("31078", "0.0") + " kW"}); + params.push_back({"输出电压", getParam("31080", "0.0") + " V"}); + params.push_back({"输出电流", getParam("31082", "0.0") + " A"}); + params.push_back({"输出功率", getParam("31084", "0.0") + " kW"}); } } diff --git a/src/app/Device.h b/src/app/Device.h index 423baa1..187cd6b 100644 --- a/src/app/Device.h +++ b/src/app/Device.h @@ -1,20 +1,41 @@ #pragma once -#include +#include #include #include #include +#include #include #include "common/Fields.h" class CommEntity; +struct DeviceParamAddr +{ + std::string name; + std::string addr; + std::string defaultVal; + std::string unit; + float ratio {1.0}; + DeviceParamAddr() {}; + DeviceParamAddr(std::string name, std::string addr, std::string defaultVal, std::string unit, float ratio=1.0f) + : name(name), addr(addr), defaultVal(defaultVal), unit(unit), ratio(ratio) + { + if (this->ratio == 0.0) + { + this->ratio = 1.0f; + } + }; +}; class Device { public: static std::shared_ptr create(Fields& fields); + static void loadParamAddr(std::string filename); + + void setFields(Fields& fields); int startComm(); @@ -28,13 +49,15 @@ public: bool cache(int npos); void storeDB(int npos); - void setParam(std::string k, std::string v); + void setParam(std::string k, int v); std::string getParam(std::string k, std::string defaultVal = ""); void getRuntimeParams(std::vector>& params); - + void getRuntimeParams1(std::vector>& params); public: + static std::map> s_mapDeviceParamAddr; + int deviceId = -1; int type = -1; std::string name; @@ -58,4 +81,8 @@ public: std::map mapCacheCurrent; std::map mapCachePower; std::map mapParams; + + std::map mapMyParams; + + }; diff --git a/src/app/Policy.cpp b/src/app/Policy.cpp index e69de29..3b1ee87 100644 --- a/src/app/Policy.cpp +++ b/src/app/Policy.cpp @@ -0,0 +1,146 @@ +#include "Policy.h" +#include "common/Spdlogger.h" +#include "Utils.h" + +void SysPolicy::setFields(Fields& fields) +{ + this->policyId = fields.get("policy_id"); + this->type = fields.get("policy_type"); + this->name = fields.value("policy_name"); + this->value = fields.value("value"); + + this->parseValue(value); +} + + +/// type=1: 峰谷套利 +static void ParseJsonType1(njson& json) +{ +} + +void SysPolicy::getGatewayJsonPrice(njson& json) +{ +} + +// 1:峰谷套利,2:配网增容,3:应急供电,4:并网保电,5:自定时段 +void SysPolicy::parseValue(std::string jsonstr) +{ + njson jsonroot; + if (!JSON::parse(jsonstr, jsonroot)) + { + spdlog::error("[policy] json parse policy value error, policy_id={}, value={}", policyId, jsonstr); + return; + } + + // 读取电价 + if (jsonroot.contains("price")) + { + auto& jsonArrayPrice = jsonroot["price"]; + for (int i = 0; i()); + } + } + } + + if (this->type == 1 || this->type == 5) + { + this->parseJsonPeriods(jsonroot); + } +} + +void SysPolicy::parseJsonPeriods(njson& jsonroot) +{ + if (!jsonroot.contains("period")) + { + spdlog::error("[policy] json parse policy value error, [period] is not exist, value={}", jsonroot.dump()); + return; + } + auto& json = jsonroot["period"]; + if (!json.is_array()) + { + spdlog::error("[policy] json parse policy value error, [period] is not array, value={}", json.dump()); + return; + } + + // 1: 谷,2:平,3:峰,4:尖 + if (this->type == 1) // 峰谷套利 + { + vecPeriods1.clear(); + for (int i = 0; i 0) + { + vecPeriods1.push_back(std::vector>()); + for (auto& itemMonth: json[i]) + { + if (itemMonth.size() >=2) { vecPeriods1[i].push_back({itemMonth[0], itemMonth[1]}); } + } + } + } + } + else if (this->type == 5) + { + //{ + // "period":[ + // {"charge_time":[],"discharge_time":[],"charge_power":"","discharge_power":""}, + // {"charge_time":[],"discharge_time":[],"charge_power":"","discharge_power":""} + // ], + // "price":["0.00","0.00","0.00","0.00"] + //} + vecPeriods1.clear(); + for (int i = 0; i>()); + auto& item = json[i]; + if (item.contains("charge_time") && item["charge_time"].size() >= 2) + { + auto& jsonP = item["charge_time"]; + vecPeriods1[i].push_back({jsonP[0], "谷"}); // 第一/二次充电开始 + vecPeriods1[i].push_back({jsonP[1], "平"}); // 第一/二次充电结束 + } + if (item.contains("discharge_time") && item["discharge_time"].size() >= 2) + { + auto& jsonP = item["discharge_time"]; + vecPeriods1[i].push_back({jsonP[0], "尖"}); // 第一/二次放电开始 + vecPeriods1[i].push_back({jsonP[1], "峰"}); // 第一/二次放电结束 + } + } + } +} + +static void PeriodsTimeStrToInt(std::string str, int& h, int& m) +{ + int pos = str.find(":"); + if (pos != std::string::npos) + { + h = Utils::toInt(str.substr(0, pos)); + m = Utils::toInt(str.substr(pos+1)); + } +} + +void SysPolicy::getGatewayJsonPeriods(njson& json) +{ + if (type == 1 || type == 5) + { + // std::vector>> + for (auto& itemMonth: vecPeriods1) + { + njson jsonArrayMonth = njson::array(); + for (auto& item: itemMonth) + { + int h = 0; int m = 0; + PeriodsTimeStrToInt(item.first, h, m); + int p = 1; + if (item.second == "谷") p = 1; + else if (item.second == "平") p = 2; + else if (item.second == "峰") p = 3; + else if (item.second == "尖") p = 4; + jsonArrayMonth.push_back({h, m, p}); + } + json.push_back(jsonArrayMonth); + } + } +} \ No newline at end of file diff --git a/src/app/Policy.h b/src/app/Policy.h index 172e238..6810cc4 100644 --- a/src/app/Policy.h +++ b/src/app/Policy.h @@ -1,15 +1,32 @@ #pragma once #include +#include #include "common/Fields.h" +#include "common/JsonN.h" -class MyPolicy +class SysPolicy { public: int policyId {0}; + + // 1:峰谷套利,2:配网增容,3:应急供电,4:并网保电,5:自定时段 int type {0}; + std::string name; std::string value; - int isOpen {0}; + int isOpen {1}; Fields fields; + + std::vector vecPrice {0.0f, 0.0f, 0.0f, 0.0f}; + + std::vector>> vecPeriods1; + + void setFields(Fields& fields); + + void parseValue(std::string jsonstr); + void parseJsonPeriods(njson& json); + + void getGatewayJsonPrice(njson& json); + void getGatewayJsonPeriods(njson& json); }; \ No newline at end of file diff --git a/src/app/Station.cpp b/src/app/Station.cpp index b68793d..a9b9062 100644 --- a/src/app/Station.cpp +++ b/src/app/Station.cpp @@ -7,6 +7,7 @@ #include "common/Utils.h" #include "protocol/MqttEntity.h" #include "common/JsonN.h" +#include "app/Config.h" Station::Station() : stationId(0) { @@ -35,10 +36,13 @@ void Station::setFields(Fields& fields) { this->stationId = fields.get(DMStation::STATION_ID); this->name = fields.value(DMStation::NAME); - this->energyCapacity = fields.get(DMStation::CAPACITY); + this->capacity = fields.get(DMStation::CAPACITY); this->workModeId = fields.get(DMStation::WORK_MODE); this->code = fields.value(DMStation::CODE); this->status = fields.get(DMStation::STATUS); + this->operationDate = fields.value(DMStation::OPERATION_DATE); + + this->policy.setFields(fields); } void Station::addDevice(int deviceId, std::shared_ptr device) @@ -47,6 +51,22 @@ void Station::addDevice(int deviceId, std::shared_ptr device) mapDeviceGroup[device->category].push_back(device); } +void Station::addDevice(Fields& fields) +{ + int deviceId = fields.get(DMDevice::DEVICE_ID); + int stationId = fields.get(DMDevice::STATION_ID); + if (mapDevice.find(deviceId) != mapDevice.end()) + { + mapDevice[deviceId]->setFields(fields); + } + else + { + auto device = Device::create(fields); + mapDevice[deviceId] = device; + mapDeviceGroup[device->category].push_back(device); + } +} + std::shared_ptr Station::getDevice(int deviceId) { auto iter = mapDevice.find(deviceId); @@ -82,8 +102,13 @@ void Station::getDeviceByType(int deviceType, std::vectorsecond.size(); + } return 0; } @@ -159,3 +184,48 @@ void Station::writeRuntimeData(std::string dt, int npos) } } } + +void Station::initMqtt() +{ + if (status!=0 && mqttCli) + { + auto& optionMqtt = Config::option.mqtt; + mqttCli->init(optionMqtt.host, code, optionMqtt.username, optionMqtt.password); + } +} + +void Station::polling() +{ + if (mqttCli) + { + mqttCli->polling(); + } +} + +void Station::setGarewayWorkMode() +{ + if (!mqttCli) + { + return; + } + + njson json; + json["ts"] = Utils::time(); + json["no"] = 1; // 设备编号 + json["40001"] = this->workModeId; + + if (policy.type == 1) + { + json["40002"] = njson::array(); // 峰谷套利 + policy.getGatewayJsonPeriods(json["40002"]); + } + else if (policy.type == 5) + { + json["40021"] = njson::array(); // 自定时段 + policy.getGatewayJsonPeriods(json["40021"]); + } + + std::string text = json.dump(); + spdlog::info(text); + mqttCli->publish("Gateway_YT", text); +} diff --git a/src/app/Station.h b/src/app/Station.h index 183200f..335be31 100644 --- a/src/app/Station.h +++ b/src/app/Station.h @@ -3,6 +3,7 @@ #include #include #include "common/Fields.h" +#include "Policy.h" class Device; class MqttClient; @@ -95,48 +96,53 @@ public: void setFields(Fields& fields); void addDevice(int deviceId, std::shared_ptr device); + void addDevice(Fields& fields); std::shared_ptr getDevice(int deviceId); std::shared_ptr getDeviceByType(int deviceType, std::string code); void getDeviceByType(int typeId, std::vector>& res); - int getDeviceNumByGroup(int category); + int getDeviceCount(int category); void getDeviceByGroup(int category, std::vector>& res); void setWorkMode(int modeId); void setPolicy(int policyId); - void writeRuntimeData(std::string dt, int npos); + void initMqtt(); + void polling(); + void setGarewayWorkMode(); public: int stationId {}; std::string name; std::string code; + bool isOpen {false}; int status {0}; + std::string operationDate; + SysPolicy policy; + bool isConnected {false}; int workModeId {}; // 运行模式 int runPolicyId {}; // 运行策略 - // 储能容量 - double energyCapacity {}; - /////////////////////////////////////////////////////////////////////////////////////////////// /// === 系统统计 === // 累计发电量,单位:kWh - double electGenTatal {}; + double electGenTotal {}; // 累计入网电量,单位:kWh double electGridTotal {}; // 累计收益,单位:元 double incomeTotal {}; - // 碳减排量, 单位:吨 - double ccers {}; // 累计储能充电电量 double electStorageIn {}; // 累计储能放电电量 double electStorageOut {}; + // 储能容量 + double capacity {}; + /////////////////////////////////////////////////////////////////////////////////////////////// /// === 日统计 === double storageIn {}; // 储能充电电量 diff --git a/src/common/Fields.h b/src/common/Fields.h index db3275d..c7c8222 100644 --- a/src/common/Fields.h +++ b/src/common/Fields.h @@ -22,7 +22,7 @@ public: Fields() {}; template - void set(string key, T val, int precision=6) + void set(string key, T val, int precision=2) { stringstream ss; ss.precision(precision); @@ -31,7 +31,7 @@ public: } template - T get(string key, int precision = 6) + T get(string key, int precision = 2) { T val {}; auto iter = mapFields.find(key); @@ -44,6 +44,18 @@ public: return val; } + template + void get(string key, T& val, int precision = 2) + { + auto iter = mapFields.find(key); + if (iter != mapFields.end()) + { + stringstream ss(iter->second); + ss.precision(precision); + ss >> val; + } + } + /** * 获取值 * @param: [string key] 索引名称 diff --git a/src/common/Utils.h b/src/common/Utils.h index d544e8a..853d950 100644 --- a/src/common/Utils.h +++ b/src/common/Utils.h @@ -99,10 +99,10 @@ public: if (t !=0) { tickMS_ = Utils::time(); } } - bool elapse(int64_t ms, bool reset = true) + bool elapse(int64_t second, bool reset = true) { auto tick_now = Utils::time(); - bool res = tick_now - tickMS_ > ms; + bool res = tick_now - tickMS_ > second; if (res && reset) { tickMS_ = tick_now; diff --git a/src/database/Dao.cpp b/src/database/Dao.cpp index 1373ba4..bd41202 100644 --- a/src/database/Dao.cpp +++ b/src/database/Dao.cpp @@ -280,7 +280,7 @@ Errcode DAO::deleteUserById(std::string userId) Errcode DAO::queryPermissionList(PageInfo& pageInfo, vector& result) { - std::string sqlFrom = "FROM " + DMPermission::TABLENAME; + std::string sqlFrom = "FROM permission WHERE permission.parent_id IS NULL OR permission.parent_id=''"; return QueryPagination("*", sqlFrom, pageInfo, result); } @@ -343,14 +343,31 @@ Errcode DAO::insertRole(Fields& params) if (err == Errcode::OK && !permission.empty()) { - // 查询获取 roleId - std::vector res; - std::string sql = "SELECT * FROM " + DMRole::TABLENAME + " WHERE name='" + name + "';"; - err = DAO::exec(dao, sql, res); - if (err == Errcode::OK && res.size() > 0) + njson jsonarray; + if (JSON::parse(permission, jsonarray)) { - //std::string roleId = res[0].value("role_id"); - //err = DAO::updateRolePermission(dao, roleId, permission); + // 查询获取 roleId + std::vector res; + std::string sql = "SELECT * FROM " + DMRole::TABLENAME + " WHERE name='" + name + "';"; + err = DAO::exec(dao, sql, res); + if (err == Errcode::OK && res.size() > 0) + { + std::string roleId = res[0].value("role_id"); + std::vector vecFields; + for (auto& item: jsonarray) + { + Fields fields; + fields.set("role_id", roleId); + fields.set("permission_id", item["permission_id"].get()); + fields.set("is_open", item["is_open"].get()); + fields.set("is_view", item["is_view"].get()); + fields.set("is_add", item["is_add"].get()); + fields.set("is_edit", item["is_edit"].get()); + fields.set("is_del", item["is_del"].get()); + vecFields.push_back(fields); + } + err = DAO::updateRolePermission(dao, roleId, vecFields); + } } } return err; diff --git a/src/database/Dao.h b/src/database/Dao.h index b6e9a4c..4945f11 100644 --- a/src/database/Dao.h +++ b/src/database/Dao.h @@ -113,7 +113,6 @@ public: // === 统计数据管理 === static Errcode queryStatDataList(std::shared_ptr dao, std::string startDate, std::string endDate, vector& result); - static Errcode queryWorkModeDef(std::shared_ptr dao, vector& result); static Errcode queryPolicyTypeDef(std::shared_ptr dao, vector& result); diff --git a/src/database/DataModelDef.h b/src/database/DataModelDef.h index e47cfd6..35e07b1 100644 --- a/src/database/DataModelDef.h +++ b/src/database/DataModelDef.h @@ -93,6 +93,7 @@ namespace DMStation const string POLICY_ID = "policy_id"; const string CODE = "code"; const string ATTR = "attr"; + const string OPERATION_DATE = "operation_date"; } namespace DMDefDeviceType diff --git a/src/database/MysqlClient.cpp b/src/database/MysqlClient.cpp index 3fac260..415c203 100644 --- a/src/database/MysqlClient.cpp +++ b/src/database/MysqlClient.cpp @@ -1,7 +1,6 @@ #include "MysqlClient.h" #include "common/Utils.h" -//#include "Spdlogger.h" -#include "Logger.h" +#include "Spdlogger.h" #include using namespace std; @@ -28,7 +27,7 @@ int MysqlClient::conn() { return 0; } - if (GetTimestamp() - g_tickErr <= 5) + if (GetTimestamp() - g_tickErr <= 10) { return 1; } @@ -73,19 +72,19 @@ static int MysqlQuery(MYSQL* mysql, const std::string& sql) int err = 0; if (!mysql) { - XLOGE() << "Mysql exec error, database is not connected."; + spdlog::error("Mysql exec error, database is not connected."); return err; } if (sql.empty()) { - XLOGE() << "Mysql exec error, sql is empty."; + spdlog::error("Mysql exec error, sql is empty."); return err; } err = mysql_query(mysql, sql.c_str()); if (0 != err) { err = mysql_errno(mysql); - XLOGE() << "Mysql exec error: " << err << "," << mysql_error(mysql) << ", sql=" << sql; + spdlog::error("Mysql exec error: {}, {}, sql={}", err, mysql_error(mysql), sql); return err; } return err; diff --git a/src/main.cpp b/src/main.cpp index fcc56a5..1cee7a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -118,22 +118,22 @@ void memberJsonTest() } + + + int main(int argc, char** argv) { // 设置控制台输出为 UTF-8 编码 SetConsoleOutputCP(CP_UTF8); // 设置控制台输入为 UTF-8 编码(如果需要输入中文) SetConsoleCP(CP_UTF8); - + // 初始化日志 Spdlogger::init(spdlog::level::debug, ""); spdlog::info("[main] start ... ======================================================================"); - spdlog::info(""); - - std::cout << Snowflake::instance().getId() << std::endl; - for (int i = 0; i<=10; ++i) { - std::cout << Snowflake::instance().getId() << std::endl; - } + njson json; + json = {1, 2, 3, 4}; + spdlog::info(json.dump()); // 运行后台服务 Application::instance().init(); diff --git a/src/protocol/HttpEntity.cpp b/src/protocol/HttpEntity.cpp index 2f33a11..1bd8c6b 100644 --- a/src/protocol/HttpEntity.cpp +++ b/src/protocol/HttpEntity.cpp @@ -39,8 +39,8 @@ static void JsonToFields(njson& json, std::vector vecKeys, Fields& case njson::value_t::number_unsigned: { fields.set(key, json[key].get()); } break; case njson::value_t::number_float: { fields.set(key, json[key].get()); } break; case njson::value_t::null: {} break; - case njson::value_t::object: {} break; - case njson::value_t::array: {} break; + case njson::value_t::object: { fields.set(key, json[key].dump()); } break; + case njson::value_t::array: { fields.set(key, json[key].dump()); } break; case njson::value_t::binary: {} break; case njson::value_t::discarded: {} break; default: @@ -165,6 +165,7 @@ static std::map g_mapHttpHandlerGet = {"/queryPredictionDetail", HandlerOptions(&HttpEntity::queryPredictionDetail, {})}, {"/queryStatSystem", HandlerOptions(&HttpEntity::queryStatSystem, {})}, + {"/queryStatStation", HandlerOptions(&HttpEntity::queryStatStation, {})}, {"/queryStatTotal", HandlerOptions(&HttpEntity::queryStatTotal, {})}, {"/queryStatDayList", HandlerOptions(&HttpEntity::queryStatDayList, {})}, {"/queryStatCharts", HandlerOptions(&HttpEntity::queryStatCharts, {})}, @@ -340,7 +341,7 @@ Errcode HttpEntity::login(const httplib::Request& req, njson& json, std::string& json["permission"] = nodePermission; } - DAO::insertSystemLogUser(token, "用户登录:" + ErrcodeStr(err), (err==Errcode::OK) ? 0: 1); + DAO::insertSystemLogUser(token, "用户登录:" + ErrcodeStr(err), (err==Errcode::OK) ? 1: 0); return err; } @@ -357,7 +358,7 @@ Errcode HttpEntity::queryUserList(const httplib::Request& req, njson& json, std: { HttpHelper::setPagination(pageinfo, result, json); } - DAO::insertSystemLogUser(token, "查询用户列表:" + ErrcodeStr(err), (err==Errcode::OK) ? 0 : 1); + //DAO::insertSystemLogUser(token, "查询用户列表:" + ErrcodeStr(err), (err==Errcode::OK) ? 1 : 0); return err; } @@ -390,6 +391,38 @@ Errcode HttpEntity::queryPermissionList(const httplib::Request& req, njson& json std::vector result; auto err = DAO::queryPermissionList(pageinfo, result); HttpHelper::setPagination(pageinfo, result, json); + + // 查询所有的角色权限关联 + if (err == Errcode::OK) + { + std::map mapP; + for (int i = 0; i vecSubPermission; + DaoEntity::execOnce("SELECT * FROM permission WHERE permission.parent_id IS NOT NULL AND permission.parent_id!='';", vecSubPermission); + + for (int i = 0; i 0) + { + int index = mapP[parentId]; + njson jsonnode; + FieldsToJson(item, jsonnode); + json["data"][index]["children"].push_back(jsonnode); + } + } + } + } return err; } @@ -423,6 +456,8 @@ Errcode HttpEntity::queryRoleList(const httplib::Request& req, njson& json, std: std::vector result; auto err = DAO::queryRoleList(pageinfo, result); + HttpHelper::setPagination(pageinfo, result, json); + // 查询所有的角色权限关联 if (err == Errcode::OK) { @@ -432,8 +467,8 @@ Errcode HttpEntity::queryRoleList(const httplib::Request& req, njson& json, std: { return err; } + std::map> mapP; - for (int i = 0; i 1) { - if (jsonparam["permission"].is_array()) + err = DAO::updateRoleById(dao, params); + } + if (err == Errcode::OK && !permission.empty()) + { + njson jsonarray; + if (JSON::parse(permission, jsonarray)) { - - auto& jsonPermission = jsonparam["permission"]; - std::vector vecFields(jsonPermission.size()); - int i = 0; - for (auto& item: jsonPermission) + std::vector vecFields; + for (auto& item: jsonarray) { - auto& fields = vecFields[i]; - i++; - JsonToFields(item, {"permission_id", "is_add", "is_del", "is_edit", "is_view"}, fields); + Fields fields; fields.set("role_id", roleId); + fields.set("permission_id", item["permission_id"].get()); + fields.set("is_open", item["is_open"].get()); + fields.set("is_view", item["is_view"].get()); + fields.set("is_add", item["is_add"].get()); + fields.set("is_edit", item["is_edit"].get()); + fields.set("is_del", item["is_del"].get()); + vecFields.push_back(fields); } err = DAO::updateRolePermission(dao, roleId, vecFields); } @@ -558,12 +601,38 @@ Errcode HttpEntity::insertStation(const httplib::Request& req, njson& json, std: Errcode HttpEntity::updateStation(const httplib::Request& req, njson& json, std::string& errmsg) { Fields params; - GetRequestParam(req, {"station_id", "name", "address", "lon", "lat", "tel", "capacity", "status", "work_mode"}, params); + GetRequestParam(req, {"station_id", "name", "address", "lon", "lat", "tel", "capacity", "status", "work_mode", "policy_id"}, params); + std::string stationId = params.value("station_id"); params.check("capacity", "", "0.0"); params.check("lon", "", "0.0"); params.check("lat", "", "0.0"); params.check("status", "", "1"); - return DAO::updateStationById(params); + Errcode err = DAO::updateStationById(params); + if (err == Errcode::OK) + { + std::string sql = "SELECT s.*, p.name policy_name, p.`type` policy_type, p.value FROM station s LEFT JOIN policy p ON s.policy_id=p.policy_id" + " WHERE s.station_id='" + stationId + "';"; + std::vector result; + int ret = DaoEntity::execOnce(sql, result); + if (ret != 0) + { + spdlog::error("[http] update station success, set station cache error, station_id={}", stationId); + } + else + { + if (result.size() > 0) + { + auto station = Application::data().getStation(Utils::toInt(stationId)); + if (station) + { + station->setFields(result[0]); + station->setGarewayWorkMode(); + } + } + + } + } + return err; }; Errcode HttpEntity::deleteStation(const httplib::Request& req, njson& json, std::string& errmsg) @@ -704,13 +773,31 @@ Errcode HttpEntity::insertDevice(const httplib::Request& req, njson& json, std:: { Fields params; GetRequestParam(req, {"station_id", "type", "name", "code", "model", "factory", "factory_tel", "is_open", "attrs"}, params); - return DAO::insertDevice(params); + if (!params.contains("station_id")) { errmsg = "缺少参数[station_id]"; return Errcode::ERR_PARAM; } + + Errcode err = DAO::insertDevice(params); + if (err == Errcode::OK) + { + int stationId = params.get("station_id"); + auto station = Application::data().getStation(stationId); + if (station) { station->addDevice(params); } + } + return err; }; + Errcode HttpEntity::updateDevice(const httplib::Request& req, njson& json, std::string& errmsg) { Fields params; GetRequestParam(req, {"device_id", "station_id", "type", "name", "code", "model", "factory", "factory_tel", "is_open", "attrs"}, params); - return DAO::updateDeviceById(params); + + Errcode err = DAO::updateDeviceById(params); + if (err == Errcode::OK) + { + int stationId = params.get("station_id"); + auto station = Application::data().getStation(stationId); + if (station) { station->addDevice(params); } + } + return err; }; Errcode HttpEntity::deleteDevice(const httplib::Request& req, njson& json, std::string& errmsg) { @@ -737,37 +824,50 @@ Errcode HttpEntity::queryDevicByCategory(const httplib::Request& req, njson& jso njson jsondata = njson::array(); auto station = Application::data().getStation(stationId); - if (station) + if (station && station->status == 1) { std::vector> vecDevice; station->getDeviceByGroup(category, vecDevice); for(auto& device: vecDevice) { - njson jsonnode; - jsonnode["stationId"] = stationId; - jsonnode["category"] = category; - jsonnode["device_id"] = device->deviceId; - jsonnode["name"] = device->name; - jsonnode["code"] = device->code; - jsonnode["type"] = device->type; - jsonnode["typename"] = Application::data().getDeviceNameById(device->type); - jsonnode["view"] = 1; - - jsonnode["is_online"] = device->online;// ? "在线" : "离线"; - jsonnode["is_error"] = device->err;// ? "故障" : "正常"; - jsonnode["is_running"] = device->running;// ? "工作" : "空闲"; - - njson jsonarrayParams = njson::array(); - VecPairSS vec; - device->getRuntimeParams(vec); - for (auto& item: vec) + if (device->isOpen) { - jsonarrayParams.push_back({{"k", item.first}, {"v", item.second}}); + njson jsonnode; + jsonnode["stationId"] = stationId; + jsonnode["category"] = category; + jsonnode["device_id"] = device->deviceId; + jsonnode["name"] = device->name; + jsonnode["code"] = device->code; + jsonnode["type"] = device->type; + jsonnode["typename"] = Application::data().getDeviceNameById(device->type); + jsonnode["view"] = 1; + jsonnode["is_online"] = device->online;// ? "在线" : "离线"; + jsonnode["is_error"] = device->err;// ? "故障" : "正常"; + jsonnode["is_running"] = device->running;// ? "工作" : "空闲"; + { + VecPairSS vec; + device->getRuntimeParams(vec); + njson jsonarrayParams = njson::array(); + for (auto& item: vec) + { + jsonarrayParams.push_back({{"k", item.first}, {"v", item.second}}); + } + jsonnode["params"] = jsonarrayParams; + } + if (device->type == 106) + { + VecPairSS vec; + device->getRuntimeParams1(vec); + njson jsonarrayParams = njson::array(); + for (auto& item: vec) + { + jsonarrayParams.push_back({{"k", item.first}, {"v", item.second}}); + } + jsonnode["params1"] = jsonarrayParams; + } + jsondata.push_back(jsonnode); } - - jsonnode["params"] = jsonarrayParams; - jsondata.push_back(jsonnode); } } json["data"] = jsondata; @@ -906,21 +1006,63 @@ Errcode HttpEntity::queryStatSystem(const httplib::Request& req, njson& json, st { auto& appdata = Application::data(); + double incomeTotal {}; + double station_num = appdata.getStationCount(); + double solarDeviceNum {}; + double capacityTotal {}; + double electGenTotal {}; + double electGridTotal {}; + double electStorageIn {}; + double electStorageOut {}; + for (auto& item : appdata.mapStation) + { + auto& station = item.second; + solarDeviceNum += station->getDeviceCount(3); + capacityTotal += station->capacity; + electGenTotal += station->electGenTotal; + electGridTotal += station->electGridTotal; + electStorageIn += station->electStorageIn; + electStorageOut += station->electStorageOut; + } + njson jsondata; jsondata["launch_date"] = appdata.launchDate; //: 系统上线启用日期,格式:yyyy-mm-dd - jsondata["income_total"] = std::to_string(Utils::random(100, 200)); // : 累计收益(元),精度0.01 - jsondata["station_num"] = Utils::toStr(appdata.getStationCount()); // : 能源站数量 - jsondata["storage_device_num "] = Utils::toStr(appdata.getStationCount()); //: 储能设备数量 - jsondata["solar_device_num"] = "0"; // : 光伏设备数量 - jsondata["capacity_total"] = std::to_string(Utils::random(100, 200)); // : 储能总容量(kWh),精度0.001 - jsondata["solar_elect_gen"] = std::to_string(Utils::random(100, 200)); // : 发电总电量(kWh),精度0.001 - jsondata["solar_elect_grid"] = std::to_string(Utils::random(100, 200)); // : 入网种电量(kWh),精度0.001 - jsondata["storage_elect_in"] = std::to_string(Utils::random(100, 200)); // : 储能充电总电量(kWh),精度0.001 - jsondata["storage_elect_out"] = std::to_string(Utils::random(100, 200)); // : 储能放电总电量(kWh),精度0.001 + jsondata["income_total"] = incomeTotal; // : 累计收益(元),精度0.01 + jsondata["station_num"] = station_num; // : 能源站数量 + jsondata["storage_device_num"] = station_num; //: 储能设备数量 + jsondata["solar_device_num"] = solarDeviceNum; //: 光伏设备数量 + jsondata["capacity_total"] = capacityTotal; // : 储能总容量(kWh),精度0.001 + jsondata["solar_elect_gen"] = electGenTotal; // : 发电总电量(kWh),精度0.001 + jsondata["solar_elect_grid"] = electGridTotal; // : 入网种电量(kWh),精度0.001 + jsondata["storage_elect_in"] = electStorageIn; // : 储能充电总电量(kWh),精度0.001 + jsondata["storage_elect_out"] = electStorageOut; // : 储能放电总电量(kWh),精度0.001 json["data"] = jsondata; return Errcode::OK; } + +Errcode HttpEntity::queryStatStation(const httplib::Request& req, njson& json, std::string& errmsg) +{ + njson jsondata = njson::array(); + + auto dao = DaoEntity::create(""); + std::string sql = R"(SELECT s.station_id, s.name station_name, ss.income_elect, ss.income_charge, ss.usage_rate FROM station s LEFT JOIN + (SELECT station_id, SUM(income_elect ) income_elect , SUM(income_charge) income_charge, avg(usage_rate) usage_rate FROM stat_staion GROUP BY station_id) AS ss + ON ss.station_id = s.station_id)"; + std::vector vecStations; + auto err = dao->exec(sql, vecStations); + for (auto& fields: vecStations) + { + njson jsonnode; + jsonnode["station_name"] = fields.value("station_name"); + jsonnode["income"] = fields.get("income_elect") + fields.get("income_charge"); + jsonnode["usage_rate"] = fields.get("usage_rate"); + jsondata.push_back(jsonnode); + } + json["data"] = jsondata; + return Errcode(err); +} + Errcode HttpEntity::queryStatTotal(const httplib::Request& req, njson& json, std::string& errmsg) { std::string station_id = req.get_param_value("station_id"); @@ -948,48 +1090,61 @@ Errcode HttpEntity::queryStatTotal(const httplib::Request& req, njson& json, std jsondata["income_charge"] = "123.123"; //充电收益(元),精度:0.01 } - - - json["data"] = jsondata; return Errcode::OK; } Errcode HttpEntity::queryStatDayList(const httplib::Request& req, njson& json, std::string& errmsg) { - std::string station_id = req.get_param_value("station_id"); - std::string category = req.get_param_value("category"); - std::string dt_start = req.get_param_value("start_date"); - std::string dt_end = req.get_param_value("end_date"); - - int64_t t1 = Utils::time(dt_start)/1000; - int64_t t2 = Utils::time(dt_end)/1000; - - int64_t tMax = t1+ 86400 * 30; - njson jsondata = njson::array(); - for (int64_t t = t1; t<=t2 && t<=tMax; t += 86400) + //std::string stationId = req.get_param_value("station_id"); + //std::string category = req.get_param_value("category"); + std::string dtStart = req.get_param_value("start_date"); + std::string dtEnd = req.get_param_value("end_date"); + if (dtEnd.empty()) { - njson jnode; - jnode["station_id"] = station_id; - if (!category.empty()) jnode["category"] = category; - jnode["dt"] = Utils::dateStr(t*1000); //日期 - jnode["storage_elect_in"] = std::to_string(Utils::random(100, 200)); //储能充电电量(kWh),精度:0.001 - jnode["storage_elect_out"] = std::to_string(Utils::random(100, 200)); //储能放电电量(kWh),精度:0.001 - jnode["storage_num_in"] = std::to_string(Utils::random(1,5)); //储能设备充电次数 - jnode["storage_num_out"] = std::to_string(Utils::random(1, 5)); //储能设备放电次数 - jnode["storage_num_err"] = std::to_string(Utils::random(1, 5)); //储能设备故障次数 - jnode["solar_elect_gen"] = std::to_string(Utils::random(100, 200)); //光伏发电电量(kWh),精度:0.001 - jnode["solar_elect_grid "] = std::to_string(Utils::random(100, 200)); //光伏入网电量(kWh),精度:0.001 - jnode["solar_num_err"] = std::to_string(Utils::random(1, 5)); //光伏设备故障次数 - jnode["charge_elect"] = std::to_string(Utils::random(100, 200)); //充电设备充电电量(kWh),精度:0.001 - jnode["charge_num"] = std::to_string(Utils::random(1, 5)); //充电设备充电次数 - jnode["charge_num_err"] = std::to_string(Utils::random(1, 5)); //充电设备故障次数 - jnode["income_elect"] = std::to_string(Utils::random(100, 200)); //发电收益(元),精度:0.01 - jnode["income_charge"] = std::to_string(Utils::random(100, 200)); //充电收益(元),精度:0.01 - jnode["usage_rate"] = std::to_string(Utils::random(10, 50)); //利用率 - jsondata.push_back(jnode); + if (dtStart.empty()) + { + dtEnd = Utils::dateStr(); + dtStart = Utils::dateStr(Utils::date() - 86400*7); + } + else + { + dtEnd = Utils::dateStr(Utils::time(dtStart + " 00:00:00") + 86400*7); + } } - json["data"] = jsondata; + + std::vector result; + Errcode err = DAO::queryStatDataList(NULL, dtStart, dtEnd, result); + json["data"] = FieldsToJsonArray(result); + return err; + + //int64_t t1 = Utils::time(dtStart); + //int64_t t2 = Utils::time(dtEnd); + //int64_t tMax = t1+ 86400 * 30; + //njson jsondata = njson::array(); + //for (int64_t t = t1; t<=t2 && t<=tMax; t += 86400) + //{ + // njson jnode; + // jnode["station_id"] = station_id; + // if (!category.empty()) jnode["category"] = category; + // jnode["dt"] = Utils::dateStr(t); //日期 + // jnode["storage_elect_in"] = std::to_string(Utils::random(100, 200)); //储能充电电量(kWh),精度:0.001 + // jnode["storage_elect_out"] = std::to_string(Utils::random(100, 200)); //储能放电电量(kWh),精度:0.001 + // jnode["storage_num_in"] = std::to_string(Utils::random(1,5)); //储能设备充电次数 + // jnode["storage_num_out"] = std::to_string(Utils::random(1, 5)); //储能设备放电次数 + // jnode["storage_num_err"] = std::to_string(Utils::random(1, 5)); //储能设备故障次数 + // jnode["solar_elect_gen"] = std::to_string(Utils::random(100, 200)); //光伏发电电量(kWh),精度:0.001 + // jnode["solar_elect_grid "] = std::to_string(Utils::random(100, 200)); //光伏入网电量(kWh),精度:0.001 + // jnode["solar_num_err"] = std::to_string(Utils::random(1, 5)); //光伏设备故障次数 + // jnode["charge_elect"] = std::to_string(Utils::random(100, 200)); //充电设备充电电量(kWh),精度:0.001 + // jnode["charge_num"] = std::to_string(Utils::random(1, 5)); //充电设备充电次数 + // jnode["charge_num_err"] = std::to_string(Utils::random(1, 5)); //充电设备故障次数 + // jnode["income_elect"] = std::to_string(Utils::random(100, 200)); //发电收益(元),精度:0.01 + // jnode["income_charge"] = std::to_string(Utils::random(100, 200)); //充电收益(元),精度:0.01 + // jnode["usage_rate"] = std::to_string(Utils::random(10, 50)); //利用率 + // jsondata.push_back(jnode); + //} + //json["data"] = jsondata; return Errcode::OK; } @@ -999,10 +1154,11 @@ Errcode HttpEntity::queryStatCharts(const httplib::Request& req, njson& json, st std::string stationId = req.get_param_value("station_id"); std::string category = req.get_param_value("category"); - if (dt.empty()) { errmsg = "参数[dt]错误"; return Errcode::ERR_PARAM; } if (stationId.empty()) { errmsg = "参数[station_id]错误"; return Errcode::ERR_PARAM; } if (category.empty()) { errmsg = "参数[category]错误"; return Errcode::ERR_PARAM; } + if (dt.empty()) { dt=Utils::dateStr(); } + njson jsondata; std::string sql = R"(SELECT hd.*, d.`type` device_type, ddt.category FROM history_day hd diff --git a/src/protocol/HttpEntity.h b/src/protocol/HttpEntity.h index a161e50..5ea0ac1 100644 --- a/src/protocol/HttpEntity.h +++ b/src/protocol/HttpEntity.h @@ -43,6 +43,7 @@ public: Errcode queryRoleList(const httplib::Request& req, njson& json, std::string& errmsg); + Errcode queryRolePermission(const httplib::Request& req, njson& json, std::string& errmsg); Errcode insertRole(const httplib::Request& req, njson& json, std::string& errmsg); Errcode updateRole(const httplib::Request& req, njson& json, std::string& errmsg); Errcode deleteRole(const httplib::Request& req, njson& json, std::string& errmsg); @@ -80,8 +81,10 @@ public: Errcode queryPredictionDetail(const httplib::Request& req, njson& json, std::string& errmsg); - // 系统总览所有场站统计 + // 系统总览所有场站统计 (总览页 运行状况) Errcode queryStatSystem(const httplib::Request& req, njson& json, std::string& errmsg); + Errcode queryStatStation(const httplib::Request& req, njson& json, std::string& errmsg); + // 一个场站的累计统计 Errcode queryStatTotal(const httplib::Request& req, njson& json, std::string& errmsg); // 场站按类别按天统计 diff --git a/src/protocol/MqttEntity.cpp b/src/protocol/MqttEntity.cpp index 8a6ebd9..a0d8296 100644 --- a/src/protocol/MqttEntity.cpp +++ b/src/protocol/MqttEntity.cpp @@ -28,8 +28,8 @@ void MqttClient::loadDataStruct(std::string filename) for (auto& jsonitem : json.items()) { std::string name = jsonitem.key(); - auto jsonnodeItem = jsonitem.value(); - int count = jsonnodeItem["count"]; + auto& jsonnodeItem = jsonitem.value(); + //int count = jsonnodeItem["count"]; auto jsonaddrs = jsonnodeItem["addr"]; auto& mapItem = g_mapRegInfo[name]; @@ -56,26 +56,34 @@ void MqttClient::loadDataStruct(std::string filename) int MqttClient::init(string addr, string clientId, string username, string password) { + if (isConnected) + { + return MQTTASYNC_SUCCESS; + } + if (addr.empty()) + { + return MQTTASYNC_FAILURE; + } + this->addr = addr; this->clientId = clientId; - this->mapTopicInfo["EMS_YX"] = 101; - this->mapTopicInfo["EMS_YX"] = 101; - this->mapTopicInfo["EMS_YC"] = 101; - this->mapTopicInfo["EMS_YT"] = 101; - this->mapTopicInfo["PCS_YX"] = 102; - this->mapTopicInfo["PCS_YC"] = 102; - this->mapTopicInfo["PCU_YX"] = 103; - this->mapTopicInfo["PCU_YC"] = 103; - this->mapTopicInfo["BMS_YX"] = 104; - this->mapTopicInfo["BMS_YC"] = 104; - this->mapTopicInfo["BCU_YX"] = 105; - this->mapTopicInfo["BCU_YC"] = 105; - this->mapTopicInfo["MEM_YC"] = 3; - this->mapTopicInfo["Cooling_YC"] = 110; - this->mapTopicInfo["TH_YC"] = 111; - this->mapTopicInfo["Gateway_YX"] = 112; - this->mapTopicInfo["Charger_YC"] = 113; + this->mapTopicInfo["EMS_YX"] = TopicInfo("EMS_YX", 101); + this->mapTopicInfo["EMS_YC"] = TopicInfo("EMS_YC", 101); + this->mapTopicInfo["EMS_YT"] = TopicInfo("EMS_YT", 101); + this->mapTopicInfo["PCS_YX"] = TopicInfo("PCS_YX", 102, 1); + this->mapTopicInfo["PCS_YC"] = TopicInfo("PCS_YC", 102, 1); + this->mapTopicInfo["PCU_YX"] = TopicInfo("PCU_YX", 103); + this->mapTopicInfo["PCU_YC"] = TopicInfo("PCU_YC", 103); + this->mapTopicInfo["BMS_YX"] = TopicInfo("BMS_YX", 104); + this->mapTopicInfo["BMS_YC"] = TopicInfo("BMS_YC", 104); + this->mapTopicInfo["BCU_YX"] = TopicInfo("BCU_YX", 105, 1); + this->mapTopicInfo["BCU_YC"] = TopicInfo("BCU_YC", 105, 1); + this->mapTopicInfo["MEM_YC"] = TopicInfo("MEM_YC", 3); + this->mapTopicInfo["Cooling_YC"] = TopicInfo("Cooling_YC", 110); + this->mapTopicInfo["TH_YC"] = TopicInfo("TH_YC", 111); + this->mapTopicInfo["Gateway_YX"] = TopicInfo("Gateway_YX", 112); + this->mapTopicInfo["Charger_YC"] = TopicInfo("Charger_YC", 113); MQTTAsync_connectOptions option = MQTTAsync_connectOptions_initializer; MQTTAsync_message pubmsg = MQTTAsync_message_initializer; @@ -168,25 +176,6 @@ void MqttClient::subscribe() MQTTAsync_responseOptions options = MQTTAsync_responseOptions_initializer; options.onSuccess = funcSuccess; options.onFailure = funcFailure; - - std::vector vecTopic = { - //"up/json/" + clientId + "/EMS_YX", - "up/json/" + clientId + "/EMS_YC", - //"up/json/" + clientId + "/EMS_YT", - //"up/json/" + clientId + "/PCU_YX", - //"up/json/" + clientId + "/PCU_YC", - //"up/json/" + clientId + "/PCS_YX", - "up/json/" + clientId + "/PCS_YC", - //"up/json/" + clientId + "/BCU_YX", - //"up/json/" + clientId + "/BCU_YC", - //"up/json/" + clientId + "/BMS_YX", - //"up/json/" + clientId + "/BMS_YC", - //"up/json/" + clientId + "/MEM_YC", - //"up/json/" + clientId + "/Cooling_YC", - //"up/json/" + clientId + "/TH_YC", - //"up/json/" + clientId + "/Gateway_YX", - //"up/json/" + clientId + "/Charger_YC", - }; for (auto& item: mapTopicInfo) { std::string topic = "up/json/" + clientId + "/" + item.first; @@ -196,41 +185,20 @@ void MqttClient::subscribe() { spdlog::error("[mqtt] subscribe [{},{}] failed, err={}", topic, qos, rc); } + else + { + spdlog::info("[mqtt] subscribe [{},{}] ", topic, qos); + } } } - -int MqttClient::polling() +int MqttClient::publish(std::string topic, std::string text) { - // 召测 发布 - std::vector vecTopic = { - "down/json/" + clientId + "/EMS_YX", - "down/json/" + clientId + "/EMS_YC", - //"down/json/" + clientId + "/EMS_YT", - //"down/json/" + clientId + "/PCU_YX", - //"down/json/" + clientId + "/PCU_YC", - //"down/json/" + clientId + "/PCS_YX", - "down/json/" + clientId + "/PCS_YC", - //"down/json/" + clientId + "/BCU_YX", - //"down/json/" + clientId + "/BCU_YC", - //"down/json/" + clientId + "/BMS_YX", - //"down/json/" + clientId + "/BMS_YC", - //"down/json/" + clientId + "/MEM_YC", - //"down/json/" + clientId + "/Cooling_YC", - //"down/json/" + clientId + "/TH_YC", - //"down/json/" + clientId + "/Gateway_YX", - //"down/json/" + clientId + "/Charger_YC", - }; - - - njson json; - json["ts"] = Utils::time(); - json["no"] = 1; - std::string text = json.dump(); + if (!client) return 0; MQTTAsync_responseOptions options = MQTTAsync_responseOptions_initializer; - //options.onSuccess = onSend; - //options.onFailure = onSendFailure; + options.onSuccess = [](void* context, MQTTAsync_successData* response) {}; + options.onFailure = [](void* context, MQTTAsync_failureData* response) {}; options.context = this; MQTTAsync_message msg = MQTTAsync_message_initializer; @@ -239,16 +207,48 @@ int MqttClient::polling() msg.payloadlen = text.size(); msg.retained = 0; - for (auto& topic: vecTopic) + std::string topicName = "down/json/" + clientId + "/" + topic; + int rc = MQTTAsync_sendMessage(client, topicName.c_str(), &msg, &options); + if (rc == MQTTASYNC_SUCCESS) { - int rc = MQTTAsync_sendMessage(client, topic.c_str(), &msg, &options); - if (rc == MQTTASYNC_SUCCESS) + spdlog::info("[mqtt] publish MQTTAsync_sendMessage success, topic={}, text={}", topicName, text); + } + else + { + spdlog::error("[mqtt] publish MQTTAsync_sendMessage error, topic={}, text={}", topicName, text); + } + return 0; +} + +int MqttClient::polling() +{ + if (!isConnected) + { + return 0; + } + + njson json; + json["ts"] = Utils::time(); + json["no"] = 0; // 设备编号 + + auto& appdata = Application::data(); + auto station = appdata.getStationByCode(clientId); + + for (auto& item: mapTopicInfo) + { + auto& topicInfo = item.second; + if (topicInfo.polling) { - spdlog::info("MQTT send message success, topic={}, text={}", topic, msg.payload); - } - else - { - spdlog::error("MQTT send message error, topic={}, text={}", topic, msg.payload); + if (station) + { + std::vector> vecDevice; + station->getDeviceByType(topicInfo.deviceType, vecDevice); + for (auto device: vecDevice) + { + json["no"] = Utils::toInt(device->code); + this->publish(topicInfo.name, json.dump()); + } + } } } return 0; @@ -292,8 +292,7 @@ int MqttClient::onMessageArrived(char* topic, int topicLen, MQTTAsync_message* m std::string command = GetSubStr("/", topicStr); std::string deviceCode = GetSubStr("/", topicStr); - spdlog::info("[mqtt] message arrived: topic=[{},{}], len={}, payload={}", topic, msg->qos, len, payload); - spdlog::info("[mqtt] parse topic: {}, stationNo={}, command={}", topic, stationNo, command); + spdlog::info("[mqtt] <<<<<<<<<< message arrived: topic=[{},{}], len={}, payload={}", topic, msg->qos, len, payload); njson json; bool ret = JSON::parse(payload, json); @@ -317,16 +316,23 @@ int MqttClient::onMessageArrived(char* topic, int topicLen, MQTTAsync_message* m } std::map& mapRegInfo = iter->second; + + auto iterTopic = mapTopicInfo.find(command); + if (iterTopic == mapTopicInfo.end()) + { + spdlog::error("[mqtt] get topic info error, clientId={}, stationId={}, command={}", clientId, stationNo, command); + return 1; + } + TopicInfo& topicInfo = iterTopic->second; + int deviceNo = -1; JSON::read(json, "no", deviceNo); - auto device = station->getDeviceByType(mapTopicInfo[command], Utils::toStr(deviceNo)); + auto device = station->getDeviceByType(topicInfo.deviceType, Utils::toStr(deviceNo)); if (!device) { return 1; } - spdlog::info("[mqtt] deviceNo={}", deviceNo); - for (auto& item: json.items()) { std::string key = item.key(); @@ -341,8 +347,8 @@ int MqttClient::onMessageArrived(char* topic, int topicLen, MQTTAsync_message* m if (iter != mapRegInfo.end()) { auto addr = iter->first; - std::string val = JSON::toStr(data[i]); - spdlog::info("[mqtt] read register addr: [{}]={}, {}", addr, val, iter->second.remark); + auto& val = data[i]; + //spdlog::info("[mqtt] read register addr: [{}]={}, {}", addr, val, iter->second.remark); device->setParam(addr, val); ++iter; } @@ -350,11 +356,11 @@ int MqttClient::onMessageArrived(char* topic, int topicLen, MQTTAsync_message* m } else if (data.is_number()) { - device->setParam(key, Utils::toStr(data.get())); + device->setParam(key, data.get()); } else if (data.is_string()) { - device->setParam(key, Utils::toStr(data.get())); + device->setParam(key, Utils::toInt(data.get())); } } } @@ -371,36 +377,13 @@ void MqttClient::onDeliveryComplete(MQTTAsync_token token) //spdlog::info("MQTT delivery complete, token={}", token); } - void MqttClient::onConnectSuccess( MQTTAsync_successData* resp) { spdlog::info("[mqtt] connect to {} success, clientId={}.", addr, clientId); this->isConnected = true; this->subscribe(); - //MQTTAsync_responseOptions options = MQTTAsync_responseOptions_initializer; - //options.context = this; - //options.onSuccess = [](void* context, MQTTAsync_successData* response) - // { - // spdlog::info("[mqtt] subscribe success."); - // }; - //options.onFailure = [](void* context, MQTTAsync_failureData* response) - // { - // spdlog::info("[mqtt] subscribe failed."); - // }; - // - //for (auto& topic: vecTopic) - //{ - // int rc = MQTTAsync_subscribe(client, topic.c_str(), qos, &options); - // if (rc != MQTTASYNC_SUCCESS) - // { - // spdlog::error("[mqtt] subscribe [{},{}] failed, err={}", topic, qos, rc); - // } - // else - // { - // spdlog::info("[mqtt] subscribe [{},{}] success", topic, qos); - // } - //} } + void MqttClient::onConnectFaiure(MQTTAsync_failureData* resp) { spdlog::error("[mqtt] connect to {} error, clientId={}.", addr, clientId); diff --git a/src/protocol/MqttEntity.h b/src/protocol/MqttEntity.h index 8528859..2d3c106 100644 --- a/src/protocol/MqttEntity.h +++ b/src/protocol/MqttEntity.h @@ -25,16 +25,16 @@ struct REGInfo } }; -//struct TopicInfo -//{ -// std::string name; -// std::string topic; -// int deviceType; -// TopicInfo() {}; -// TopicInfo(std::string name, std::string topic, int deviceType) -// :name(name), topic(topic), deviceType(deviceType) -// {}; -//}; +struct TopicInfo +{ + std::string name; + int deviceType {0}; + int polling {0}; // 召测 + TopicInfo() {}; + TopicInfo(std::string name, int deviceType, int polling=0) + :name(name), deviceType(deviceType), polling(polling) + {}; +}; using namespace std; @@ -47,8 +47,7 @@ public: void destory(); void subscribe(); - //int publish(); - + int publish(std::string topic, std::string text); int polling(); void onConnectionLost(char* cause); @@ -61,6 +60,7 @@ public: void parseEMS_YX(std::shared_ptr station, njson& json, std::map& mapRegInfo); public: + // MQTT clientId (使用station 的 code) std::string clientId; MQTTAsync client = nullptr; @@ -69,7 +69,7 @@ public: bool isConnected {false}; bool isSubscribed {false}; - std::map mapTopicInfo; + std::map mapTopicInfo; }; diff --git a/src/qt/MainWeb.cpp b/src/qt/MainWeb.cpp index 1f49cf4..7a96ca8 100644 --- a/src/qt/MainWeb.cpp +++ b/src/qt/MainWeb.cpp @@ -8,6 +8,10 @@ #include #include #include +#include +#include + +#include "common/Spdlogger.h" void MySplash(MainWeb* mainWin) { @@ -44,6 +48,47 @@ MainWeb::MainWeb() this->setWindowTitle("光储充站监控与运营管理平台"); this->setGeometry(0, 0, 1920, 1080); this->hide(); + //this->setMouseTracking(true); + this->setAttribute(Qt::WA_Hover, true); + + this->initWebview(); + this->mySplash(); + + btnFullscreen.setParent(this); + btnFullscreen.raise(); + btnFullscreen.setGeometry(0, 0, 34, 34); + btnFullscreen.setStyleSheet("background: transparent; background-image: url(./assets/ui/iconFullscreen.png);"); + + QObject::connect(&btnFullscreen, &QPushButton::clicked, [=](bool checked) + { + isFullscreen ? this->showNormal() : this->showFullScreen(); + isFullscreen = !isFullscreen; + if (isFullscreen) + { + btnFullscreen.setStyleSheet("background: transparent; background-image: url(./assets/ui/iconFullscreenExit.png);"); + } + else + { + btnFullscreen.setStyleSheet("background: transparent; background-image: url(./assets/ui/iconFullscreen.png);"); + } + }); + + this->show(); +} + + +void MainWeb::initWebview() +{ + labelWebErr.setParent(this); + labelWebErr.setGeometry(180, 100, 800, 50); + labelWebErr.setText("WEB服务异常!!!"); + labelWebErr.setStyleSheet("font: bold 20px;"); + labelWebErr.hide(); + + qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "9222"); // 即使内置视图,有时也需要开启调试端口 + //this->setCentralWidget(&webView); + webView.setParent(this); + webView.setGeometry(0, 0, 1920, 1080); // 在加载页面之前清除缓存 //QWebEngineProfile::defaultProfile()->clearHttpCache(); @@ -52,19 +97,33 @@ MainWeb::MainWeb() //settings->setAttribute(QWebEngineSettings::LocalStorageEnabled, true); //settings->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, true); // 解决http资源加载问题 //settings->setAttribute(QWebEngineSettings::PluginsEnabled, true); - - webView.setGeometry(0, 0, 1920, 1080); // 默认设置透明, 解决加载时的白屏闪烁 //webView.page()->setBackgroundColor(Qt::transparent); //webView.setContextMenuPolicy(Qt::NoContextMenu); webView.load(QUrl(Config::option.webSrvUrl.c_str())); - this->setCentralWidget(&webView); - + webView.hide(); + // 将主 Web 页面的开发者工具页面设置为 devToolsView 的页面 + webView.page()->setDevToolsPage(devTools.page()); + QObject::connect(&webView, &QWebEngineView::loadFinished, [=](bool ok) + { + if (ok) + { + webView.show(); + labelWebErr.hide(); + } + else + { + spdlog::error("[web] webview load failed, url={}", Config::option.webSrvUrl); + webView.hide(); + labelWebErr.show(); + } + }); +} +void MainWeb::mySplash() +{ //===动态程序启动画面=== - splash = std::make_shared(QPixmap("./assets/ui/splash.png")); - QCoreApplication::processEvents(); label1.setParent(splash.get()); label1.setStyleSheet("background-color: gray"); @@ -73,33 +132,75 @@ MainWeb::MainWeb() labelProgress.setParent(splash.get()); labelProgress.setStyleSheet("background-color: rgb(29, 54, 102)"); labelProgress.setGeometry(10, 10, 0, 20); - + splash->show(); label1.show(); labelProgress.show(); + int i = 0; + while ((++i)<100) + { + splash->showMessage(QString("Loading... %1 ms").arg(i), Qt::AlignBottom | Qt::AlignRight, Qt::black); + labelProgress.setGeometry(100, 480, i*10*0.8, 20); + QCoreApplication::processEvents(); + QThread::msleep(20); + } + splash->finish(this);//程序启动画面结束 +} - QObject::connect(&webView, &QWebEngineView::loadFinished, [=](bool ok) - { - if (ok) - { - int i = 0; - while ((++i)<100) - { - splash->showMessage(QString("Loading... %1 ms").arg(i), Qt::AlignBottom | Qt::AlignRight, Qt::black); - labelProgress.setGeometry(100, 480, i*10*0.8, 20); - QCoreApplication::processEvents(); - QThread::msleep(20); - } - splash->finish(this);//程序启动画面结束 - this->show(); - } - else - { - qDebug() << "页面加载失败!"; - // 这里可以执行加载失败后的处理 - } - }); +void MainWeb::showDevTools() +{ + if (layout) + { + //webView.setParent(this); + //QLayoutItem* item; + //while ((item = layout->takeAt(0)) != nullptr) { // 不断取出第一个项 + // //if (item->widget()) { + // // delete item->widget(); // 删除控件 + // //} + // //else if (item->layout()) { // 如果是子QLayout + // // delete item->layout(); // 删除子布局 + // //} + // delete item; // 最后删除QLayoutItem本身 + //} + //delete layout; + //layout = NULL; + } + else + { + // 如果你需要先导航主页面,然后在某个事件(如按钮点击)后显示开发者工具,可以将这行代码放在事件处理函数中。 + layout = new QHBoxLayout(this); + // 将两个视图添加到布局中 + layout->addWidget(&webView); + layout->addWidget(&devTools); + layout->setStretch(0, 2); // 主视图占2份 + layout->setStretch(1, 1); // 开发者工具视图占1份 + } +} - //this->show(); +bool MainWeb::event(QEvent* e) +{ + if (QEvent::HoverMove == e->type())//鼠标移动 + { + QHoverEvent* hoverEvent = static_cast(e); + int x = hoverEvent->pos().x(); + int y = hoverEvent->pos().y(); + + if (x > 40 || y > 40) { btnFullscreen.hide(); } + else { btnFullscreen.show(); } + } + return QWidget::event(e); +} + +void MainWeb::keyPressEvent(QKeyEvent* e) +{ + auto key = e->key(); + if (key == Qt::Key_F12) + { + this->showDevTools(); + } + else if (key == Qt::Key_F5) + { + webView.load(QUrl(Config::option.webSrvUrl.c_str())); + } } \ No newline at end of file diff --git a/src/qt/MainWeb.h b/src/qt/MainWeb.h index 96305fb..ce3aeb4 100644 --- a/src/qt/MainWeb.h +++ b/src/qt/MainWeb.h @@ -2,15 +2,36 @@ #include #include #include +#include +#include -class MainWeb : public QMainWindow +class MainWeb : public QWidget { Q_OBJECT public: MainWeb(); + void initWebview(); + void mySplash(); + void showDevTools(); + + bool event(QEvent* e); + void keyPressEvent(QKeyEvent* event); + +public: + QLabel labelWebErr; QWebEngineView webView; - std::shared_ptr splash {}; + QWebEngineView devTools; + + + + std::shared_ptr splash; QLabel label1; QLabel labelProgress; + + QLabel labelFullscreen; + QPushButton btnFullscreen; + bool isFullscreen = false; + + QHBoxLayout* layout = NULL; }; \ No newline at end of file diff --git a/web/src/components/DetailInfo.vue b/web/src/components/DetailInfo.vue index 0ab790a..2f82a93 100644 --- a/web/src/components/DetailInfo.vue +++ b/web/src/components/DetailInfo.vue @@ -277,7 +277,6 @@ /> option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1) } - +function getBase64(img, callback) { + const reader = new FileReader() + reader.addEventListener('load', () => callback(reader.result)) + reader.readAsDataURL(img) +} function avatarUploadChange(info) { if (info.file.status === 'uploading') { data.loading = true @@ -532,11 +535,7 @@ function avatarUploadChange(info) { function onFieldsChange() {} function handleSubmit() {} -function getBase64(img, callback) { - const reader = new FileReader() - reader.addEventListener('load', () => callback(reader.result)) - reader.readAsDataURL(img) -} + // 主动暴露方法 defineExpose({ diff --git a/web/src/components/EditCom.vue b/web/src/components/EditCom.vue index 1c843c0..ac71c0e 100644 --- a/web/src/components/EditCom.vue +++ b/web/src/components/EditCom.vue @@ -56,17 +56,17 @@ scroll: { y: 500 } }" > -