Commit e9464f01 LN

伺服发送数据增加休眠

1 个父辈 a9e1bee3
......@@ -339,7 +339,7 @@ namespace OnlineStore.Common
return -1;
}
private byte PreSlvAddr = 0;
/// <summary>
/// 发送命令
/// </summary>
......@@ -363,6 +363,17 @@ namespace OnlineStore.Common
//Monitor.Enter(lockObj);
try
{
//判断是否需要休眠
if (SendData != null && SendData.Length > 0)
{
if (!SendData[0].Equals(PreSlvAddr))
{
Thread.Sleep(50);
PreSlvAddr = SendData[0];
}
}
_serialPort.DiscardInBuffer(); //清空接收缓冲区
_serialPort.Write(SendData, 0, SendData.Length);
int num = 0, ret = 0;
......
......@@ -375,8 +375,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_14_NGCylinderBack))
{
MoveEndS();
LogUtil.info(hengyiName + MoveInfo.SLog + "NG处理结束 ,清理NG工位");
StationInfo_NG = new StationTrayInfo();
LogUtil.info(hengyiName + MoveInfo.SLog + "NG处理结束 ");
// StationInfo_NG = new StationTrayInfo();
}
#endregion
......@@ -394,7 +394,8 @@ namespace OnlineStore.DeviceLibrary
runStatus = LineRunStatus.Busy;
MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.OutStore);
LogUtil.info(hengyiName + "NG工位有料,NG气缸后退,等待100后获取尺寸");
LogUtil.info(hengyiName + "NG工位有料,NG气缸后退,等待100后获取尺寸,清理NG工位");
StationInfo_NG = new StationTrayInfo();
MoveInfo.NextMoveStep(LineMoveStep.DON_01_WaitTime);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
ScanNgBack(MoveInfo);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!