From 131c4f536cac9a0eb5040bf5b6fe68d4b0af5fb4 Mon Sep 17 00:00:00 2001 From: xjl <2595686544@qq.com> Date: Mon, 29 Jul 2024 17:53:52 +0800 Subject: [PATCH] =?UTF-8?q?plc=E5=9C=B0=E5=9D=80=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Plc/Msg/HostToPlc.cs | 128 ++++++++++++++++++---------- Service/Plc/Msg/PlcToHost.cs | 160 ++++++++++++++++++++++++++++------- 2 files changed, 212 insertions(+), 76 deletions(-) diff --git a/Service/Plc/Msg/HostToPlc.cs b/Service/Plc/Msg/HostToPlc.cs index 82388a1..3618887 100644 --- a/Service/Plc/Msg/HostToPlc.cs +++ b/Service/Plc/Msg/HostToPlc.cs @@ -44,35 +44,43 @@ namespace Service.Plc.Msg /// 1010:全部关闭 /// public ModbusProperty LightingControl { get; set; } = new(40008); // - - public ModbusProperty Standby1 { get; set; } = new(40009); // 备用 - public ModbusProperty Standby2 { get; set; } = new(40010); // 备用 - /// - /// 对时时钟:秒 - /// - public ModbusProperty Seconds { get; set; } = new(40011); - /// - /// 对时时钟:分 - /// - public ModbusProperty Points { get; set; } = new(40012); /// - /// 对时时钟:时 - /// - public ModbusProperty Hour { get; set; } = new(40013); - /// - /// 对时时钟:天 - /// - public ModbusProperty Day { get; set; } = new(40014); - /// - /// 对时时钟:月 + /// 三色灯控制整站状态(入口) + /// 0:无效值 + /// 1000:绿灯 + /// 1010:绿灯闪烁 + /// 1020:红灯 + /// 1030:红灯闪烁 + /// 1040:黄灯 + /// 1050:黄灯闪烁 + /// 1100:所有灯亮 /// - public ModbusProperty Month { get; set; } = new(40015); + public ModbusProperty LightIn { get; set; } = new(40009); /// - /// 对时时钟:年 + /// 三色灯控制引导状态(出口) + /// 0:无效值 + /// 1000:绿灯 + /// 1010:绿灯闪烁 + /// 1020:红灯 + /// 1030:红灯闪烁 + /// 1040:黄灯 + /// 1050:黄灯闪烁 + /// 1100:所有灯亮 /// - public ModbusProperty Years { get; set; } = new(40016); - //public ModbusProperty Standby3 { get; set; } = new(40017, length: 4); // 备用36 - //public ModbusProperty ChargingStatus { get; set; } = new(40021, length: 40); // 仓位充电状态 + public ModbusProperty LightOut { get; set; } = new(40010); + + public ModbusProperty Standby1 { get; set; } = new(40011); // 备用 + public ModbusProperty Standby2 { get; set; } = new(40012); // 备用 + public ModbusProperty Standby3 { get; set; } = new(40013); // 备用 + public ModbusProperty Standby4 { get; set; } = new(40014); // 备用 + public ModbusProperty Standby5 { get; set; } = new(40015); // 备用 + public ModbusProperty Standby6 { get; set; } = new(40016); // 备用 + public ModbusProperty Standby7 { get; set; } = new(40017); // 备用 + public ModbusProperty Standby8 { get; set; } = new(40018); // 备用 + public ModbusProperty Standby9 { get; set; } = new(40019); // 备用 + public ModbusProperty Standby10 { get; set; } = new(40020); // 备用 + + #region 默认20个舱位信息(预留20舱位地用于扩展) /// /// 仓位充电状态 /// 0:未知 @@ -213,7 +221,9 @@ namespace Service.Plc.Msg /// 1010:充电 /// public ModbusProperty ChargingStatus20 { get; set; } = new(40040); - //public ModbusProperty BatteryType { get; set; } = new(40061, length: 40); // 仓位所在电池型号 + #endregion + + #region 电池型号单一,可以不填 /// /// 仓位所在电池型号 /// @@ -294,6 +304,8 @@ namespace Service.Plc.Msg /// 仓位所在电池型号 /// public ModbusProperty BatteryType20 { get; set; } = new(40080); + #endregion + /// /// 车辆驻车位置 @@ -323,7 +335,7 @@ namespace Service.Plc.Msg /// 1050:黄灯闪烁 /// 1100:所有灯亮 /// - public ModbusProperty LightIn { get; set; } = new(40103); + public ModbusProperty LightIn2 { get; set; } = new(40103); /// /// 三色灯控制整站状态(出口) /// 0:无效值 @@ -335,36 +347,39 @@ namespace Service.Plc.Msg /// 1050:黄灯闪烁 /// 1100:所有灯亮 /// - public ModbusProperty LightOut { get; set; } = new(40104); + public ModbusProperty LightOut2 { get; set; } = new(40104); /// - /// 电池包锁止异常,暂停命令 0:无命令;1000:暂停使能 + /// 电池包锁止状态 0:加锁;1000:解锁 /// public ModbusProperty StopCommand { get; set; } = new(40105); - //public ModbusProperty Standby4 { get; set; } = new(40106, length: 5); // 备用4 + + public ModbusProperty Standby11 { get; set; } = new(40106); //备用 + public ModbusProperty Standby12 { get; set; } = new(40107); //备用 + public ModbusProperty Standby13 { get; set; } = new(40108); //备用 + public ModbusProperty Standby14 { get; set; } = new(40109); //备用 + public ModbusProperty Standby15 { get; set; } = new(40110); //备用 /// /// 任务类型 - /// 0.无任务 - /// 1.换电任务 - /// 2.移舱任务 - /// 3.移出任务 - /// 4.移入任务 - /// 5.消防任务 + /// 0.待机 + /// 1.任务异常结束 + /// 2.换电任务 + /// 3.入库任务 + /// 4.出库任务 + /// 5.维护任务 + /// 6.调库任务 + /// 7.消防任务 /// public ModbusProperty TaskType { get; set; } = new(40111); /// /// 入仓位选择 - /// 0:无操作 - /// 范围:1-20 - /// 1:缓存位舱位号 - /// 2-20 电池存储舱位 + /// 站控直接下发仓位1-8 + /// PLC来区分左右仓位区别 /// public ModbusProperty EntrySelection { get; set; } = new(40112); /// /// 出仓仓位选择 - /// 0:无操作 - /// 范围:1-20 - /// 1:缓存位舱位号 - /// 2-20 电池存储舱位 + /// 站控直接下发仓位1-8 + /// PLC来区分左右仓位区别 /// public ModbusProperty ExitSelection { get; set; } = new(40113); /// @@ -372,10 +387,31 @@ namespace Service.Plc.Msg /// public ModbusProperty BatteryPackType { get; set; } = new(40114); /// - /// 0:无操作 - /// 1000:任务使能 + /// 任务使能 + /// 0:无操作 + /// 1000:任务使能 /// public ModbusProperty TaskEnablement { get; set; } = new(40115); + /// + /// 卷帘门控制 + /// 0:无操作 + /// 1000:请求开启 + /// 1010:请求关闭 + /// + public ModbusProperty RollerShutter { get; set; } = new(40116); + /// + /// 除换电任务外放仓位选择 + /// 站控直接下发仓位1-8(右侧电池仓) + /// 站控直接下发仓位11-18(左仓电池仓) + /// + public ModbusProperty EntrySelection2 { get; set; } = new(40117); + /// + /// 除换电任务外取仓位选择 + /// 站控直接下发仓位1-8(右侧电池仓) + /// 站控直接下发仓位11-18(左仓电池仓) + /// + public ModbusProperty ExitSelection2 { get; set; } = new(40118); + } } diff --git a/Service/Plc/Msg/PlcToHost.cs b/Service/Plc/Msg/PlcToHost.cs index 01e616d..e52b4a5 100644 --- a/Service/Plc/Msg/PlcToHost.cs +++ b/Service/Plc/Msg/PlcToHost.cs @@ -67,7 +67,7 @@ namespace Service.Plc.Msg /// //public ModbusProperty<1> value09 { get; set; } = new(40211, length: 30); - #region 舱位状态 bit0:有料检测 Bit1:有料检测开关故障 + #region 右仓电池在位状态 舱位状态 bit0:有料检测 Bit1:有料检测开关故障 public ModbusProperty MaterialDetec01 { get; set; } = new(40241); @@ -93,12 +93,37 @@ namespace Service.Plc.Msg #endregion 舱位状态 + #region 右仓电池在位状态 舱位状态 bit0:有料检测 Bit1:有料检测开关故障 + + + public ModbusProperty MaterialDetec21 { get; set; } = new(40261); + public ModbusProperty MaterialDetec22 { get; set; } = new(40262); + public ModbusProperty MaterialDetec23 { get; set; } = new(40263); + public ModbusProperty MaterialDetec24 { get; set; } = new(40264); + public ModbusProperty MaterialDetec25 { get; set; } = new(40265); + public ModbusProperty MaterialDetec26 { get; set; } = new(40266); + public ModbusProperty MaterialDetec27 { get; set; } = new(40267); + public ModbusProperty MaterialDetec28 { get; set; } = new(40268); + public ModbusProperty MaterialDetec29 { get; set; } = new(40269); + public ModbusProperty MaterialDetec30 { get; set; } = new(40270); + public ModbusProperty MaterialDetec31 { get; set; } = new(40271); + public ModbusProperty MaterialDetec32 { get; set; } = new(40272); + public ModbusProperty MaterialDetec33 { get; set; } = new(40273); + public ModbusProperty MaterialDetec34 { get; set; } = new(40274); + public ModbusProperty MaterialDetec35 { get; set; } = new(40275); + public ModbusProperty MaterialDetec36 { get; set; } = new(40276); + public ModbusProperty MaterialDetec37 { get; set; } = new(40277); + public ModbusProperty MaterialDetec38 { get; set; } = new(40278); + public ModbusProperty MaterialDetec39 { get; set; } = new(40279); + public ModbusProperty MaterialDetec40 { get; set; } = new(40280); + + #endregion 舱位状态 /// /// 备用 /// - public ModbusProperty value11 { get; set; } = new(40281, length: 20); + public ModbusProperty value1 { get; set; } = new(40281, length: 20); /// - /// 载行车设备状态 + /// 右侧载行车设备状态 /// 0:无效值 /// 1000:待机中 /// 1001:定位识别中 @@ -111,23 +136,71 @@ namespace Service.Plc.Msg /// public ModbusProperty CarStatus { get; set; } = new(40301); - public ModbusProperty value13 { get; set; } = new(40302); // 备用 - public ModbusProperty value14 { get; set; } = new(40303); // 备用 - public ModbusProperty value15 { get; set; } = new(40304); // 备用 - public ModbusProperty value16 { get; set; } = new(40305); // 备用 + public ModbusProperty value2 { get; set; } = new(40302); // 备用 + public ModbusProperty value3 { get; set; } = new(40303); // 备用 + public ModbusProperty value4 { get; set; } = new(40304); // 备用 + public ModbusProperty value5 { get; set; } = new(40305); // 备用 /// - /// x轴扭矩百分比 + /// 右侧x轴扭矩百分比 /// public ModbusProperty PercentageTorqueX { get; set; } = new(40306); /// - /// y轴扭矩百分比 + /// 右侧y轴扭矩百分比 /// public ModbusProperty PercentageTorqueY { get; set; } = new(40307); /// - /// z轴扭矩百分比 + /// 右侧z轴扭矩百分比 /// public ModbusProperty PercentageTorqueZ { get; set; } = new(40308); - //public ModbusProperty value20 { get; set; } = new(40309, length: 92); // 备用 + /// + /// 右侧R轴扭矩百分比 + /// + public ModbusProperty PercentageTorqueR { get; set; } = new(40309); + /// + /// 卷帘门状态 + /// 0:无操作 + /// 1000:请求开启 + /// 1010:请求关闭 + /// + public ModbusProperty RollerShutter { get; set; } = new(40116); + //public ModbusProperty value6 { get; set; } = new(40116,length:12); + /// + /// 左侧载行车设备状态 + /// 0:无效值 + /// 1000:待机中 + /// 1001:定位识别中 + /// 1100:取电池中 + /// 1101:取电池完成 + /// 1102:取电池动作故障 + /// 1200:放电池中 + /// 1201:放电池完成 + /// 1202:放电池动作故障 + /// + public ModbusProperty CarStatus2 { get; set; } = new(40321); + + public ModbusProperty value6 { get; set; } = new(40322); // 备用 + public ModbusProperty value7 { get; set; } = new(40323); // 备用 + public ModbusProperty value8 { get; set; } = new(40324); // 备用 + public ModbusProperty value9 { get; set; } = new(40325); // 备用 + /// + /// 左侧x轴扭矩百分比 + /// + public ModbusProperty PercentageTorqueX2 { get; set; } = new(40326); + /// + /// 左侧y轴扭矩百分比 + /// + public ModbusProperty PercentageTorqueY2 { get; set; } = new(40327); + /// + /// 左侧z轴扭矩百分比 + /// + public ModbusProperty PercentageTorqueZ2 { get; set; } = new(40328); + /// + /// 左侧R轴扭矩百分比 + /// + public ModbusProperty PercentageTorqueR2 { get; set; } = new(40329); + + //public ModbusProperty value6 { get; set; } = new(40116,length:71); + /// /// 入口雷达状态 /// 0:未触发 @@ -177,17 +250,19 @@ namespace Service.Plc.Msg /// public ModbusProperty LightOut { get; set; } = new(40406); /// - /// 任务类型状态(是否允许允许执行任务) - /// 0.无任务 (不允许换电) - /// 1.换电任务 - /// 2.移舱任务 - /// 3.移出任务 - /// 4.移入任务 - /// 5.消防任务 - /// + /// 任务类型状态 + /// 0.待机 + /// 1.任务异常结束 + /// 2.换电任务 + /// 3.入库任务 + /// 4.出库任务 + /// 5.维护任务 + /// 6.调库任务 + /// 7.消防任务 + /// public ModbusProperty TaskType { get; set; } = new(40407); /// - /// 任务状态 + /// 堆垛机任务状态 /// 0:无效值 /// 1000:准备中(Not Ready) /// 1001:待机中(Ready) @@ -205,12 +280,10 @@ namespace Service.Plc.Msg /// 9000:任务完成 /// public ModbusProperty TaskStates { get; set; } = new(40408); + + public ModbusProperty value10 { get; set; } = new(40409); /// - /// 执行任务行车号 - /// - public ModbusProperty OperationalTrainNumber { get; set; } = new(40409); - /// - /// 通道定位状态 + /// 右侧堆垛机相机定位状态 /// 0:无效值 /// 1000;拍照OK /// 1010;拍照NG @@ -218,20 +291,47 @@ namespace Service.Plc.Msg /// public ModbusProperty ChannelLocationState { get; set; } = new(40410); /// - /// x偏差 + /// 右侧堆垛机相机x偏差 /// public ModbusProperty DeviationX { get; set; } = new(40411); /// - /// y偏差 + /// 右侧堆垛机相机y偏差 /// public ModbusProperty DeviationY { get; set; } = new(40412); /// - /// z偏差 + /// 右侧堆垛机相机z偏差 /// public ModbusProperty DeviationZ { get; set; } = new(40413); - //public ModbusProperty value44 { get; set; } = new(40414, length: 7); // 备用 - + /// + /// 右侧堆垛机相机R偏差 + /// + public ModbusProperty DeviationR { get; set; } = new(40414); + public ModbusProperty value11 { get; set; } = new(40409,length:13); + /// + /// 左侧堆垛机相机定位状态 + /// 0:无效值 + /// 1000;拍照OK + /// 1010;拍照NG + /// 1020;拍照超限,请移车 + /// + public ModbusProperty ChannelLocationState2 { get; set; } = new(40428); + /// + /// 左侧堆垛机相机x偏差 + /// + public ModbusProperty DeviationX2 { get; set; } = new(40429); + /// + /// 左侧堆垛机相机y偏差 + /// + public ModbusProperty DeviationY2 { get; set; } = new(40430); + /// + /// 左侧堆垛机相机z偏差 + /// + public ModbusProperty DeviationZ2 { get; set; } = new(40431); + /// + /// 左侧堆垛机相机R偏差 + /// + public ModbusProperty DeviationR2 { get; set; } = new(40432); } }