1111
This commit is contained in:
@ -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";
|
||||
|
Reference in New Issue
Block a user