This commit is contained in:
2025-04-18 14:03:42 +08:00
parent 6182dc2192
commit 73f8d2b968
16 changed files with 1904 additions and 261 deletions

View File

@ -815,6 +815,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>
@ -1026,6 +1050,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";