正在改尺寸测量

This commit is contained in:
2025-04-18 14:06:48 +08:00
16 changed files with 1840 additions and 200 deletions

View File

@ -817,6 +817,30 @@ namespace DH.Devices.PLC
WriteBool(pLCItem.Address, b);
}
/// <summary>
/// 转盘方向
/// </summary>
/// <param name="b"></param>
public void TurnDirection(bool b)
{
PLCItem? pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘方向");
if (pLCItem == null)
return;
WriteBool(pLCItem.Address, b);
}
/// <summary>
/// 转盘速度
/// </summary>
/// <param name="b"></param>
public void TurnSpeed(int speed)
{
PLCItem? pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "转盘速度");
if (pLCItem == null)
return;
WriteUInt16(pLCItem.Address, (ushort)speed);
}
/// <summary>
/// 转盘启停
/// </summary>
@ -1028,6 +1052,16 @@ namespace DH.Devices.PLC
}
public int ReadVisionPos()
{
PLCItem? pLCItem = PLCItemList.FirstOrDefault(u => u.Name == "定位完成脉冲值");
if (pLCItem == null)
return 0;
int value = ReadInt32(pLCItem.Address);
Thread.Sleep(10);
return Math.Abs(value);
}
public void LogAsync(LogMsg msg)
{
msg.MsgSource = "PLC";