Commit 26d2917a 几米阳光

1

1 个父辈 b31bb69f
...@@ -81,7 +81,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -81,7 +81,7 @@ namespace OnlineStore.DeviceLibrary
aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ; aioBox.DI_Changed_Event += AioBox_DI_Changed_Event; ;
aioBox.DO_Changed_Event += AioBox_DO_Changed_Event; aioBox.DO_Changed_Event += AioBox_DO_Changed_Event;
aioBox.Log_Out_Event += AioBox_Log_Out_Event; aioBox.Log_Out_Event += AioBox_Log_Out_Event;
aioBox.Log_RxTx_Event += AioBox_Log_RxTx_Event; //aioBox.Log_RxTx_Event += AioBox_Log_RxTx_Event;
AIOMap.Add(ioIp, aioBox); AIOMap.Add(ioIp, aioBox);
LogUtil.info("开始连接IO模块[" + ioIp + "]["+DIMS+"]["+DOMS+"],尝试重连三次"); LogUtil.info("开始连接IO模块[" + ioIp + "]["+DIMS+"]["+DOMS+"],尝试重连三次");
for (int i = 1; i <= 3; i++) for (int i = 1; i <= 3; i++)
...@@ -129,26 +129,26 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,26 +129,26 @@ namespace OnlineStore.DeviceLibrary
} }
private DateTime lastLogTime = DateTime.Now; private DateTime lastLogTime = DateTime.Now;
private void AioBox_Log_RxTx_Event(AIOBOX box, string[] s) //private void AioBox_Log_RxTx_Event(AIOBOX box, string[] s)
{ //{
TimeSpan span = DateTime.Now - lastLogTime; // TimeSpan span = DateTime.Now - lastLogTime;
if (span.TotalMinutes > 1) // //if (span.TotalMinutes > 1)
// {
// lastLogTime = DateTime.Now;
// foreach (string str in s)
// {
// LogUtil.AIOLog.Debug("[" + box.IP + "]" + str);
// }
// }
//}
private void AioBox_Log_Out_Event(AIOBOX box, string[] s)
{ {
lastLogTime = DateTime.Now;
foreach (string str in s) foreach (string str in s)
{ {
LogUtil.AIOLog.Debug("[" + box.IP + "]" + str); LogUtil.AIOLog.Debug("[" + box.IP + "]" + str);
} }
} }
}
private void AioBox_Log_Out_Event(AIOBOX box, string[] s)
{
//foreach (string str in s)
//{
// LogUtil.AIOLog.Debug( "["+box.IP+"]"+ str);
//}
}
private void AioBox_DI_Changed_Event(AIOBOX box, Box_Sta[] sta) private void AioBox_DI_Changed_Event(AIOBOX box, Box_Sta[] sta)
{ {
......
...@@ -165,15 +165,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -165,15 +165,7 @@ namespace OnlineStore.DeviceLibrary
{ {
timeOutMs = 650000; timeOutMs = 650000;
} }
if (!wait.IsEnd && span.TotalSeconds > 1 && (wait.IoType.Equals(IO_Type.SuckingDisc_Air) ))
{
IO_VALUE doValue = IOManager.DOValue(wait.IoType);
if (!doValue.Equals(wait.IoValue))
{
LogUtil.error("等待[" + NotOkMsg + "],重写DO(" + wait.IoType + "=" + wait.IoValue + ")");
IOManager.IOMove(wait.IoType, wait.IoValue);
}
}
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
...@@ -737,6 +729,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -737,6 +729,7 @@ namespace OnlineStore.DeviceLibrary
if (BatchNeedMove) if (BatchNeedMove)
{ {
StoreMove.TimeOutSeconds = 120; StoreMove.TimeOutSeconds = 120;
Thread.Sleep(1000);
ACAxisMove(Config.Batch_Axis, targetValue, Config.BatchAxis_P1_Speed); ACAxisMove(Config.Batch_Axis, targetValue, Config.BatchAxis_P1_Speed);
OutStoreLog("出库:SO_03 批量轴下降【" + outDownPosition + "】目标【" + targetValue + "】 "); OutStoreLog("出库:SO_03 批量轴下降【" + outDownPosition + "】目标【" + targetValue + "】 ");
Thread.Sleep(100); Thread.Sleep(100);
......
...@@ -268,7 +268,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -268,7 +268,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
TimeSpan span = DateTime.Now - AxisResetMoveTime; TimeSpan span = DateTime.Now - AxisResetMoveTime;
if ((AutoBaitingStatus.Equals(StoreRunStatus.Busy)||AutoBaitingStatus.Equals(StoreRunStatus.Reset)) && span.TotalSeconds > 3) if ((AutoBaitingStatus.Equals(StoreRunStatus.Busy)||AutoBaitingStatus.Equals(StoreRunStatus.Reset)) && span.TotalSeconds > 10)
//if (AutoBaitingStatus.Equals(StoreRunStatus.Busy) && StoreMove.CanWhileCount > 0) //if (AutoBaitingStatus.Equals(StoreRunStatus.Busy) && StoreMove.CanWhileCount > 0)
{ {
AxisResetMoveTime = DateTime.Now; AxisResetMoveTime = DateTime.Now;
...@@ -277,9 +277,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -277,9 +277,9 @@ namespace OnlineStore.DeviceLibrary
if (isEnd) if (isEnd)
{ //判断是否需要重新运动 { //判断是否需要重新运动
StoreMove.CanWhileCount--; StoreMove.CanWhileCount--;
LogUtil.error(wait.ToStr() + "未收到信号且停止运动,重新匀速" + StoreManager.Config.BatchAxis_SlowSpeed + "运动,剩余[" + StoreMove.CanWhileCount + "]次"); LogUtil.error(wait.ToStr() + " 未收到信号且停止运动,重新匀速" + StoreManager.Config.BatchAxis_SlowSpeed + "运动,剩余[" + StoreMove.CanWhileCount + "]次");
ACServerManager.SuddenStop(wait.AxisInfo); ACServerManager.SuddenStop(wait.AxisInfo);
Thread.Sleep(300); Thread.Sleep(2000);
ACServerManager.SpeedMove(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue(), StoreManager.Config.BatchAxis_SlowSpeed); ACServerManager.SpeedMove(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue(), StoreManager.Config.BatchAxis_SlowSpeed);
} }
} }
......
...@@ -376,7 +376,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -376,7 +376,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(LOGGER, moveAxis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次"); "],误差过大,重新开始运动,剩余[" + StoreMove.CanWhileCount + "]次");
ACServerManager.SuddenStop(moveAxis); ACServerManager.SuddenStop(moveAxis);
Thread.Sleep(300); Thread.Sleep(1000);
ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), targetPosition, targetSpeed);
StoreMove.CanWhileCount--; StoreMove.CanWhileCount--;
return false; return false;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!