Commit 994b6ae4 LN

伺服停止方法调用3次

1 个父辈 5973fb58
......@@ -878,6 +878,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_CylinderGive))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_22_BatchAxisDown);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
if (!MoveInfo.ShelfNoTray)
{
FI_BatchAxisDown();
......@@ -915,39 +916,9 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,更新托盘信息 :" + LastPosParam.ToShortStr());
LastPosParam.TrayNumber = currTrayNum;
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, LastPosParam, LastPosParam.NgMsg);
SServerManager.SendPosToStoreCheck(Name, LastPosParam);
//string code = CodeManager.ProcessCode(LastCodeList);
//lastcode = code;
//getPosTask = Task.Factory.StartNew(delegate
//{
// int sTrayNum = currTrayNum;
// //更新托盘条码信息
// try
// {
// if (code.Equals(""))
// {
// InOutParam param = new InOutParam(sTrayNum, code, "", LastHeight, LastWidth, true);
// TrayManager.UpdateTrayInfo(sTrayNum, true, ReelType.InStore, param, "扫码失败");
// }
// //从服务器获取库位号
// string result = SServerManager.CodeReceived(Name, sTrayNum, LastCodeList, LastHeight, LastWidth, CurrShelfId, DeviceID);
// if (!result.Equals(""))
// {
// InOutParam param = new InOutParam(sTrayNum, code, "", LastHeight, LastWidth, true);
// param.rfid = CurrShelfId;
// TrayManager.UpdateTrayInfo(sTrayNum, true, ReelType.InStore, param, result);
// // TrayManager.UpdateInStoreNG(currTrayNum, true, result);
// LogUtil.error(Name + "托盘【" + sTrayNum + "】" + result);
// }
// }
// catch (Exception ex)
// {
// LogUtil.error(Name + "托盘【" + sTrayNum + "】【" + code + "】获取库位号报错:" + ex.ToString());
// }
//});
SServerManager.SendPosToStoreCheck(Name, LastPosParam);
}
else if (MoveInfo.IsTimeOut(180))
{
......@@ -1089,7 +1060,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_GetPosID);
InLog("清空LastPosResult,从服务器获取入库库位");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
LastPosParam = null;
string code = CodeManager.ProcessCode(LastCodeList);
lastcode = code;
......
......@@ -281,11 +281,24 @@ namespace OnlineStore.DeviceLibrary
int length = 2;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
System.Threading.Thread.Sleep(500);
data = "0000";
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
SendData(portName, dataArray);
for (int i = 1; i <= 3; i++)
{
bool result = SendData(portName, dataArray);
if (result)
{
System.Threading.Thread.Sleep(500);
data = "0000";
dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteCoil, addr, data, length);
result = SendData(portName, dataArray);
break;
}
else
{
LogUtil.error("【" + portName + "_" + slvAddr + "】 , 第" + i + "次,SuddenStop 发送数据失败");
Thread.Sleep(500);
}
}
}
public static void OpenAndCloseSTB(string portName, int slvAddr)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!