diff --git a/Service/PlcAfrica/Msg/PlcAfricaMsg.cs b/Service/PlcAfrica/Msg/PlcAfricaMsg.cs index 5754597..cbd6b23 100644 --- a/Service/PlcAfrica/Msg/PlcAfricaMsg.cs +++ b/Service/PlcAfrica/Msg/PlcAfricaMsg.cs @@ -79,17 +79,17 @@ public class PlcAfricaMsg /// /// 车上亏电电池高度 /// - public ModbusProperty BatteryHeight {get;set;}= new(47011); + public ModbusProperty BatteryHeight {get;set;}= new(47014); /// /// 车上亏电电池长度 /// - public ModbusProperty BatteryLength {get;set;}= new(47012); + public ModbusProperty BatteryLength {get;set;}= new(47018); /// /// 车上亏电电池宽度 /// - public ModbusProperty BatteryWidth {get;set;}= new(47013); + public ModbusProperty BatteryWidth {get;set;}= new(47022); /// /// 备用 @@ -99,57 +99,57 @@ public class PlcAfricaMsg /// /// 备用 /// - public ModbusProperty standby02 {get;set;}= new(47050,start:2,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby02 {get;set;}= new(47050,start:1,length:1,type:ModbusDataType.Bit); /// /// 备用 /// - public ModbusProperty standby03 {get;set;}= new(47050,start:3,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby03 {get;set;}= new(47050,start:2,length:1,type:ModbusDataType.Bit); /// /// 备用 /// - public ModbusProperty standby04 {get;set;}= new(47050,start:4,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby04 {get;set;}= new(47050,start:3,length:1,type:ModbusDataType.Bit); /// /// 充电机散热风扇1 0-关闭排风扇,1-开启排风 /// - public ModbusProperty ChargerCoolingFan1 {get;set;}= new(47050,start:5,length:1,type:ModbusDataType.Bit); + public ModbusProperty ChargerCoolingFan1 {get;set;}= new(47050,start:4,length:1,type:ModbusDataType.Bit); /// /// 充电机散热风扇2 /// - public ModbusProperty ChargerCoolingFan2 {get;set;}= new(47050,start:6,length:1,type:ModbusDataType.Bit); + public ModbusProperty ChargerCoolingFan2 {get;set;}= new(47050,start:5,length:1,type:ModbusDataType.Bit); /// /// 充电机散热风扇3 /// - public ModbusProperty ChargerCoolingFan3 {get;set;}= new(47050,start:7,length:1,type:ModbusDataType.Bit); + public ModbusProperty ChargerCoolingFan3 {get;set;}= new(47050,start:6,length:1,type:ModbusDataType.Bit); /// /// 充电机散热风扇4 /// - public ModbusProperty ChargerCoolingFan4 {get;set;}= new(47050,start:8,length:1,type:ModbusDataType.Bit); + public ModbusProperty ChargerCoolingFan4 {get;set;}= new(47050,start:7,length:1,type:ModbusDataType.Bit); /// /// 备用 /// - public ModbusProperty standby05 {get;set;}= new(47050,start:9,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby05 {get;set;}= new(47050,start:8,length:1,type:ModbusDataType.Bit); /// /// 备用 /// - public ModbusProperty standby06 {get;set;}= new(47050,start:10,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby06 {get;set;}= new(47050,start:9,length:1,type:ModbusDataType.Bit); /// /// 备用 /// - public ModbusProperty standby07 {get;set;}= new(47050,start:11,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby07 {get;set;}= new(47050,start:10,length:1,type:ModbusDataType.Bit); /// /// 备用 /// - public ModbusProperty standby08 {get;set;}= new(47050,start:12,length:1,type:ModbusDataType.Bit); + public ModbusProperty standby08 {get;set;}= new(47050,start:11,length:1,type:ModbusDataType.Bit); /// /// PLC向站控发送关机指令 0-无动作 @@ -326,7 +326,7 @@ public class PlcAfricaMsg /// /// 加载机2落座传感器1 /// - public ModbusProperty Loader2SeatSensor1 {get;set;}= new(49043,start:2,length:1,type:ModbusDataType.Bit); + public ModbusProperty Loader2SeatSensor1 {get;set;}= new(49043,start:1,length:1,type:ModbusDataType.Bit); /// /// 加载机2落座传感器2 @@ -336,7 +336,7 @@ public class PlcAfricaMsg /// /// 加载机3落座传感器1 /// - public ModbusProperty Loader3SeatSensor1 {get;set;}= new(49043,start:4,length:1,type:ModbusDataType.Bit); + public ModbusProperty Loader3SeatSensor1 {get;set;}= new(49043,start:2,length:1,type:ModbusDataType.Bit); /// /// 加载机3落座传感器2 @@ -346,7 +346,7 @@ public class PlcAfricaMsg /// /// 加载机4落座传感器1 /// - public ModbusProperty Loader4SeatSensor1 {get;set;}= new(49043,start:6,length:1,type:ModbusDataType.Bit); + public ModbusProperty Loader4SeatSensor1 {get;set;}= new(49043,start:3,length:1,type:ModbusDataType.Bit); /// /// 加载机4落座传感器2 @@ -411,7 +411,10 @@ public class PlcAfricaMsg /// /// 架载机状态 /// - public ModbusProperty BoardStatus {get;set;}= new(49150); + public ModbusProperty BoardStatus1 {get;set;}= new(49150,start:0,length:2,type:ModbusDataType.Bit); + public ModbusProperty BoardStatus2 {get;set;}= new(49150,start:2,length:2,type:ModbusDataType.Bit); + public ModbusProperty BoardStatus3 {get;set;}= new(49150,start:4,length:2,type:ModbusDataType.Bit); + public ModbusProperty BoardStatus4 {get;set;}= new(49150,start:6,length:2,type:ModbusDataType.Bit); /// /// TBOX解锁 @@ -581,11 +584,11 @@ public class PlcAfricaMsg /// /// 中转仓落座传感器1 /// - public ModbusProperty TransferBinSeatSensor1 {get;set;}= new(49038,start:0,length:1,type:ModbusDataType.Bit); + public ModbusProperty TransferBinSeatSensor1 {get;set;}= new(49438,start:0,length:1,type:ModbusDataType.Bit); /// /// 中转仓落座传感器2 /// - public ModbusProperty TransferBinSeatSensor2 {get;set;}= new(49038,start:1,length:1,type:ModbusDataType.Bit); + public ModbusProperty TransferBinSeatSensor2 {get;set;}= new(49438,start:1,length:1,type:ModbusDataType.Bit); } \ No newline at end of file diff --git a/WinFormStarter/FrmAfrica.cs b/WinFormStarter/FrmAfrica.cs index 876d585..15b06bb 100644 --- a/WinFormStarter/FrmAfrica.cs +++ b/WinFormStarter/FrmAfrica.cs @@ -67,7 +67,7 @@ namespace WinFormStarter { if (!PlcAfricaClient.Connected) return; PlcAfricaMsg.OperationInstruction.Value = Convert.ToUInt16(txt21.Text); - PlcAfricaClient.WriteValue(PlcAfricaMsg.OperationInstruction); + bool bv= PlcAfricaClient.WriteValue(PlcAfricaMsg.OperationInstruction); } /// @@ -86,7 +86,7 @@ namespace WinFormStarter { if (!PlcAfricaClient.Connected) return; PlcAfricaMsg.BatteryHeight.Value = Convert.ToUInt16(txt23.Text); - PlcAfricaClient.WriteValue(PlcAfricaMsg.BatteryHeight); + bool bv= PlcAfricaClient.WriteValue(PlcAfricaMsg.BatteryHeight); } private void BtnWrite07_Click(object sender, EventArgs e) @@ -194,8 +194,8 @@ namespace WinFormStarter private void button4_Click(object sender, EventArgs e) { if (!PlcAfricaClient.Connected) return; - PlcAfricaMsg.BoardStatus.Value = Convert.ToUInt16(txt62.Text); - PlcAfricaClient.WriteValue(PlcAfricaMsg.BoardStatus); + PlcAfricaMsg.BoardStatus1.Value = Convert.ToByte(txt62.Text); + PlcAfricaClient.WriteValue(PlcAfricaMsg.BoardStatus1); } private void button8_Click(object sender, EventArgs e) @@ -281,8 +281,8 @@ namespace WinFormStarter private void button19_Click(object sender, EventArgs e) { if (!PlcAfricaClient.Connected) return; - PlcAfricaMsg.ChargerTempIn5.Value = Convert.ToUInt16(txt92.Text); - PlcAfricaClient.WriteValue(PlcAfricaMsg.ChargerTempIn5); + PlcAfricaMsg.ChargerTempIn6.Value = Convert.ToUInt16(txt92.Text); + PlcAfricaClient.WriteValue(PlcAfricaMsg.ChargerTempIn6); } private void button18_Click(object sender, EventArgs e)