1.移植查询电压值功能

This commit is contained in:
hehaibing-1996
2024-05-28 20:09:24 +08:00
parent ac14b22507
commit 08850a2f15
9 changed files with 227 additions and 6 deletions

View File

@ -65,11 +65,22 @@ namespace WCS.BLL.HardWare
/// </summary>
public byte[] GoOutStockTakingModeData = { 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/// <summary>
/// 复位命令
/// </summary>
public byte[] ResetData = { 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/// <summary>
/// 查询当前电压值
/// </summary>
public byte[] VoltageSingleData = { 0x17, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/// <summary>
/// 电压偏移值
/// </summary>
public byte[] OffsetSingleData = { 0x18, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
/// <summary>
/// 电压标准值
/// </summary>
public byte[] StandardSingleData = { 0x19, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#endregion
public int ModuleId { get; set; }
public string ModuleCode { get; set; }
@ -370,5 +381,21 @@ namespace WCS.BLL.HardWare
tcpClient.Send(tcpClient.GenerateMessage(BoardId, ComfirmOutstoreData));
}
/// <summary>
/// 查询电压值
/// </summary>
/// <param name="tcpClient"></param>
public void QueryVoltage(TCPClient tcpClient)
{
Thread.Sleep(10);
Task.Run(() =>
{
tcpClient.Send(tcpClient.GenerateMessage(BoardId, VoltageSingleData));
Thread.Sleep(50);
tcpClient.Send(tcpClient.GenerateMessage(BoardId, StandardSingleData));
Thread.Sleep(50);
tcpClient.Send(tcpClient.GenerateMessage(BoardId, OffsetSingleData));
});
}
}
}