plc读取更改

master
CZ 4 days ago
parent fe5609513d
commit 9cea1aa579

@ -79,17 +79,17 @@ public class PlcAfricaMsg
/// <summary>
/// 车上亏电电池高度
/// </summary>
public ModbusProperty<ushort> BatteryHeight {get;set;}= new(47011);
public ModbusProperty<ushort> BatteryHeight {get;set;}= new(47014);
/// <summary>
/// 车上亏电电池长度
/// </summary>
public ModbusProperty<ushort> BatteryLength {get;set;}= new(47012);
public ModbusProperty<ushort> BatteryLength {get;set;}= new(47018);
/// <summary>
/// 车上亏电电池宽度
/// </summary>
public ModbusProperty<ushort> BatteryWidth {get;set;}= new(47013);
public ModbusProperty<ushort> BatteryWidth {get;set;}= new(47022);
/// <summary>
/// 备用
@ -99,57 +99,57 @@ public class PlcAfricaMsg
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby02 {get;set;}= new(47050,start:2,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby02 {get;set;}= new(47050,start:1,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby03 {get;set;}= new(47050,start:3,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby03 {get;set;}= new(47050,start:2,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby04 {get;set;}= new(47050,start:4,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby04 {get;set;}= new(47050,start:3,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 充电机散热风扇1 0-关闭排风扇1-开启排风
/// </summary>
public ModbusProperty<bool> ChargerCoolingFan1 {get;set;}= new(47050,start:5,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> ChargerCoolingFan1 {get;set;}= new(47050,start:4,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 充电机散热风扇2
/// </summary>
public ModbusProperty<bool> ChargerCoolingFan2 {get;set;}= new(47050,start:6,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> ChargerCoolingFan2 {get;set;}= new(47050,start:5,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 充电机散热风扇3
/// </summary>
public ModbusProperty<bool> ChargerCoolingFan3 {get;set;}= new(47050,start:7,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> ChargerCoolingFan3 {get;set;}= new(47050,start:6,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 充电机散热风扇4
/// </summary>
public ModbusProperty<bool> ChargerCoolingFan4 {get;set;}= new(47050,start:8,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> ChargerCoolingFan4 {get;set;}= new(47050,start:7,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby05 {get;set;}= new(47050,start:9,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby05 {get;set;}= new(47050,start:8,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby06 {get;set;}= new(47050,start:10,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby06 {get;set;}= new(47050,start:9,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby07 {get;set;}= new(47050,start:11,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby07 {get;set;}= new(47050,start:10,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 备用
/// </summary>
public ModbusProperty<bool> standby08 {get;set;}= new(47050,start:12,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> standby08 {get;set;}= new(47050,start:11,length:1,type:ModbusDataType.Bit);
/// <summary>
/// PLC向站控发送关机指令 0-无动作
@ -326,7 +326,7 @@ public class PlcAfricaMsg
/// <summary>
/// 加载机2落座传感器1
/// </summary>
public ModbusProperty<bool> Loader2SeatSensor1 {get;set;}= new(49043,start:2,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> Loader2SeatSensor1 {get;set;}= new(49043,start:1,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 加载机2落座传感器2
@ -336,7 +336,7 @@ public class PlcAfricaMsg
/// <summary>
/// 加载机3落座传感器1
/// </summary>
public ModbusProperty<bool> Loader3SeatSensor1 {get;set;}= new(49043,start:4,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> Loader3SeatSensor1 {get;set;}= new(49043,start:2,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 加载机3落座传感器2
@ -346,7 +346,7 @@ public class PlcAfricaMsg
/// <summary>
/// 加载机4落座传感器1
/// </summary>
public ModbusProperty<bool> Loader4SeatSensor1 {get;set;}= new(49043,start:6,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> Loader4SeatSensor1 {get;set;}= new(49043,start:3,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 加载机4落座传感器2
@ -411,7 +411,10 @@ public class PlcAfricaMsg
/// <summary>
/// 架载机状态
/// </summary>
public ModbusProperty<ushort> BoardStatus {get;set;}= new(49150);
public ModbusProperty<ushort> BoardStatus1 {get;set;}= new(49150,start:0,length:2,type:ModbusDataType.Bit);
public ModbusProperty<ushort> BoardStatus2 {get;set;}= new(49150,start:2,length:2,type:ModbusDataType.Bit);
public ModbusProperty<ushort> BoardStatus3 {get;set;}= new(49150,start:4,length:2,type:ModbusDataType.Bit);
public ModbusProperty<ushort> BoardStatus4 {get;set;}= new(49150,start:6,length:2,type:ModbusDataType.Bit);
/// <summary>
/// TBOX解锁
@ -581,11 +584,11 @@ public class PlcAfricaMsg
/// <summary>
/// 中转仓落座传感器1
/// </summary>
public ModbusProperty<bool> TransferBinSeatSensor1 {get;set;}= new(49038,start:0,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> TransferBinSeatSensor1 {get;set;}= new(49438,start:0,length:1,type:ModbusDataType.Bit);
/// <summary>
/// 中转仓落座传感器2
/// </summary>
public ModbusProperty<bool> TransferBinSeatSensor2 {get;set;}= new(49038,start:1,length:1,type:ModbusDataType.Bit);
public ModbusProperty<bool> TransferBinSeatSensor2 {get;set;}= new(49438,start:1,length:1,type:ModbusDataType.Bit);
}

@ -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);
}
/// <summary>
@ -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)

Loading…
Cancel
Save