Commit ab7e32ab LN

横移模块优化,紧急出料优化

1 个父辈 b552f79b
......@@ -114,11 +114,11 @@ namespace OnlineStore.Common
catch(WebException ex)
{
IsTimeOut = true;
LogUtil.error("POST WebException :" + ex .ToString(), 101);
LogUtil.error("POST ["+ url + "]["+paramData+"] WebException :" + ex .ToString(), 101);
}
catch (Exception e)
{
LogUtil.error("POST ERROR:" + e.ToString(), 101);
LogUtil.error("POST [" + url + "][" + paramData + "] ERROR:" + e.ToString(), 101);
}
if (!result.Contains("null") && result.Length != 0)
{
......
......@@ -286,15 +286,15 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopUp))
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_07_LocationUp);
CheckLog("托盘检测: " + SecondMoveInfo.SLog + " , 定位气缸上升 )");
if (Config.SidesWayNum > 0)
{
CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_07_LocationUp))
{
// SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_07_LocationUp);
// CheckLog("托盘检测: " + SecondMoveInfo.SLog + " , 定位气缸上升 )");
// if (Config.SidesWayNum > 0)
// {
// CylinderMove(SecondMoveInfo, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
// }
//}
//else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_07_LocationUp))
//{
CheckLog("托盘阻挡*************** 托盘号【" + currTrayNum + "】");
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
......@@ -303,6 +303,10 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + "*************** 托盘号【" + currTrayNum + "】 ,需要入料,移栽料盘");
SecondMoveInfo.EndStepWait();
if (Config.SidesWayNum > 0)
{
CylinderMove(null, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
}
}
else
{
......@@ -310,6 +314,10 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitFeedNoMove());
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " ,托盘号【" + currTrayNum + "】需要出库,等待开始出库");
if (Config.SidesWayNum > 0)
{
CylinderMove(null, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
}
}
}
......@@ -506,7 +514,7 @@ namespace OnlineStore.DeviceLibrary
}
private void SMoveEnd()
{
lastStopDown = DateTime.Now.AddSeconds(-2);
lastStopDown = DateTime.Now.AddSeconds(-1);
SecondMoveInfo.EndMove();
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
......@@ -903,7 +911,10 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CylinderDown);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
if (Config.SidesWayNum > 0)
{
CylinderMove(MoveInfo, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
}
LastPosParam.TrayNumber = currTrayNum;
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,更新托盘信息 :" + LastPosParam.ToShortStr());
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, LastPosParam, LastPosParam.NgMsg);
......
......@@ -86,6 +86,7 @@ namespace OnlineStore.DeviceLibrary
LastOutParam = outParam;
//可以开始出库啦
MoveInfo.NextMoveStep(LineMoveStep.FO_211_AxisDownMove);
CylinderMove(MoveInfo, IO_Type.SW_LocationCylinder_Down, IO_Type.SW_LocationCylinder_Up);
int height = outParam.PlateH + 4;
int targetPosition = BatchAxis.GetAclPosition() - height * Config.Height_ChangeValue;
if (targetPosition < Config.BatchAxisP2)
......@@ -93,20 +94,19 @@ namespace OnlineStore.DeviceLibrary
targetPosition = Config.BatchAxisP2;
}
OutLog("出库移栽 " + MoveInfo.SLog + " :提升伺服下降" + height + "mm,目标:" + targetPosition);
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
if (MoveCylineIsUp()||MoveInfo.MoveParam.PlateW.Equals(7))
{
//已经在取料端
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take))
{
int targetP = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
if (MoveInfo.MoveParam.PlateW.Equals(7))
{
//升降先下降
CylinderMove(null, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
int targetP = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
}
else if(MoveCylineIsUp())
{
......@@ -121,6 +121,7 @@ namespace OnlineStore.DeviceLibrary
{
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_P2Speed);
return true;
}
public void StartOutStoreP()
......@@ -526,22 +527,20 @@ namespace OnlineStore.DeviceLibrary
int targetP = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
if (UpdownAxis.IsInPosition(targetP))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_214_CylinderDown);
OutLog(outType + MoveInfo.SLog + ":上料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
{
FO_214_CylinderDown(outType);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FO_213_UpdownAxisToP2);
OutLog(outType + MoveInfo.SLog + ":升降伺服下降到P2:" + targetP);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
if (MoveInfo.MoveParam.PlateW.Equals(7))
{
//升降先下降
CylinderMove(null, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
}
}
else
......@@ -579,9 +578,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_213_UpdownAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_214_CylinderDown);
OutLog(outType + MoveInfo.SLog + ":上料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
FO_214_CylinderDown(outType);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_214_CylinderDown))
{
......@@ -729,9 +726,22 @@ namespace OnlineStore.DeviceLibrary
}
}
}
private void SendOutShelfOut(string msg="")
private void FO_214_CylinderDown(string outType)
{
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_215_CylinderTighten);
OutLog(outType + MoveInfo.SLog + ":上料气缸夹紧");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Slack, IO_Type.SL_MoveCylinder_Tighten);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FO_214_CylinderDown);
OutLog(outType + MoveInfo.SLog + ":上料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
}
private void SendOutShelfOut(string msg="")
{
MoveInfo.NextMoveStep(LineMoveStep.FO_30_BatchAxisToP2);
OutStoreHeight = -1;
......
......@@ -1029,20 +1029,26 @@ namespace OnlineStore.DeviceLibrary
//>> - code: 0为正常,其他为异常,
// >> - msg:消息,
// >> - data:
List<AlarmMsg> alarmList = new List<AlarmMsg>();
foreach (EquipBase equip in AllEquipMap.Values)
try
{
if (equip.alarmType.Equals(LineAlarmType.None) || equip.WarnMsg.Contains("等待空托盘到达超时"))
{
continue;
}
else
List<AlarmMsg> alarmList = new List<AlarmMsg>();
foreach (EquipBase equip in AllEquipMap.Values)
{
alarmList.Add(new AlarmMsg(equip.Name,"line."+ equip.Name + "_" + equip.alarmType, equip.WarnMsg));
if (equip.alarmType.Equals(LineAlarmType.None) || equip.WarnMsg.Contains("等待空托盘到达超时"))
{
continue;
}
else
{
alarmList.Add(new AlarmMsg(equip.Name, "line." + equip.Name + "_" + equip.alarmType, equip.WarnMsg));
}
}
SServerManager.updateDeviceAlarmMsg(alarmList);
}
catch (Exception ex)
{
LogUtil.error("ServerConTimer_Elapsed 出错:" + ex.ToString());
}
SServerManager.updateDeviceAlarmMsg(alarmList);
}
}
}
\ No newline at end of file
......@@ -308,9 +308,17 @@ namespace OnlineStore.DeviceLibrary
return true;
}
else if (SW23_MoveInfo.MoveStep <= (LineMoveStep.SW12_WaitTrayGo)
&& SW23_MoveInfo.MoveStep >= (LineMoveStep.SW10_WatOutFixture2))
&& SW23_MoveInfo.MoveStep >= (LineMoveStep.SW10_WatOutFixture2)
)
{
return true;
if (CylinderIsOk(IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down))
{
return true;
}
else
{
CylinderMove(null, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
}
}
}
else if (sidesWayNum.Equals(3) && SW23WaitTrayNum < 0 && runStatus <= LineRunStatus.Wait)
......@@ -326,7 +334,14 @@ namespace OnlineStore.DeviceLibrary
else if (SW41_MoveInfo.MoveStep <= (LineMoveStep.SW12_WaitTrayGo)
&& SW41_MoveInfo.MoveStep >= (LineMoveStep.SW10_WatOutFixture2))
{
return true;
if (CylinderIsOk(IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down))
{
return true;
}
else
{
CylinderMove(null, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
}
}
}
else if (sidesWayNum.Equals(1) && SW41WaitTrayNum < 0 && runStatus <= LineRunStatus.Wait)
......@@ -354,8 +369,7 @@ namespace OnlineStore.DeviceLibrary
return true;
}
if (sidesWayNum.Equals(3))
{
// TimeSpan span = DateTime.Now - FeedingEquipMap[104].lastStopDown;
{
LineMoveInfo moveInfo = FeedingEquipMap[104].SecondMoveInfo;
if (IOValue(IO_Type.SW3_TrayCheck).Equals(IO_VALUE.LOW) && moveInfo.MoveType.Equals(LineMoveType.None))
{
......@@ -365,8 +379,7 @@ namespace OnlineStore.DeviceLibrary
else if (sidesWayNum.Equals(1))
{
LineMoveInfo moveInfo = FeedingEquipMap[101].SecondMoveInfo;
// TimeSpan span = DateTime.Now - FeedingEquipMap[101].lastStopDown;
if (IOValue(IO_Type.SW1_TrayCheck).Equals(IO_VALUE.LOW) && moveInfo.MoveType.Equals(LineMoveType.None))
{
return true;
......@@ -635,15 +648,15 @@ namespace OnlineStore.DeviceLibrary
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck);
SWLog("横移轨道41:收到SW1_TrayCheck,先顶升4下降 ");
CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
CylinderMove(null, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH));
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck))
{
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW10_WatOutFixture2);
SWLog("横移轨道41:再次验证托盘是否在出口处,停止横移4的皮带线 ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW1_TrayCheck, IO_VALUE.HIGH));
//需要停止横移4的皮带线
IOMove(IO_Type.SW4_MotorRun, IO_VALUE.LOW);
......@@ -659,6 +672,7 @@ namespace OnlineStore.DeviceLibrary
{
CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
}
//CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
}
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW11_TopDown))
{
......@@ -877,15 +891,15 @@ namespace OnlineStore.DeviceLibrary
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW09_WaitOutCheck);
SWLog("横移轨道23:收到 SW3_TrayCheck,先顶升2下降, ");
CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
CylinderMove(null, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
//SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH));
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW09_WaitOutCheck))
{
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW10_WatOutFixture2);
SWLog("横移轨道23:再次验证托盘是否在出口处 ,停止横移2的皮带线 ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW3_TrayCheck, IO_VALUE.HIGH));
IOMove(IO_Type.SW2_MotorRun, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_MotorRun, IO_VALUE.LOW));
......@@ -900,6 +914,7 @@ namespace OnlineStore.DeviceLibrary
{
CylinderMove(SW23_MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
}
//CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
}
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW11_TopDown))
{
......
......@@ -125,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-2);
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
}
......@@ -375,7 +375,7 @@ namespace OnlineStore.DeviceLibrary
}
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-2);
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
}
......@@ -402,20 +402,7 @@ namespace OnlineStore.DeviceLibrary
else
{
CheckLog("托盘阻挡 " + SecondMoveInfo.SLog + " 顶升气缸上升 ");
}
//SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_06_TopUp);
//CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
//if (Config.SidesWayNum.Equals(4) && LineManager.Line.SwCanUpMove(1))
//{
// CheckLog("托盘阻挡 " + SecondMoveInfo.SLog + " 顶升气缸上升,同时横移1处的顶升也可以上升 ");
// LineManager.Line.CylinderMove(null, IO_Type.SW1_TopCylinder_Down, IO_Type.SW1_TopCylinder_Up);
//}
//else
//{
// CheckLog("托盘阻挡 " + SecondMoveInfo.SLog + " 顶升气缸上升 ");
//}
}
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopUp))
{
......@@ -438,7 +425,7 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.EndMove();
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
lastStopDown = DateTime.Now.AddSeconds(-2);
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
else
......@@ -480,7 +467,7 @@ namespace OnlineStore.DeviceLibrary
{
CheckLog("托盘放行 结束,触发 TrayPEndEvent ");
SecondMoveInfo.EndMove();
lastStopDown = DateTime.Now.AddSeconds(-2);
lastStopDown = DateTime.Now.AddSeconds(-1);
this.TrayPEndEvent?.Invoke(Config.SidesWayNum, currTrayNum);
}
#endregion
......
......@@ -604,25 +604,26 @@ namespace OnlineStore.DeviceLibrary
// > 地址:
//>>/ rest / api / qisda / device / updateDeviceAlarmMsg
// >
// > 参数:
//>> deviceAlarmList : 异常列表Json字符串 `[{"name":"移栽5", "msgKey":"line.move5.timeOut", "msgValue":"运动超时"},{"name":"移栽4", "msgKey":"line.move4.timeOut", "msgValue":"误差过大"}]`
//>>>name : 异常位置名称
//>>>msgKey : 异常信息唯一标识
//>>>msgValue : 异常信息
//>
//> 返回:
//>>` {"code":0,"msg":"ok","data":""}`
//>>
//>> - code: 0为正常,其他为异常,
// >> - msg:消息,
// >> - data:
private static string Addr_updateDeviceAlarmMsg = "/rest/api/qisda/device/updateDeviceAlarmMsg";
public static string updateDeviceAlarmMsg(List<AlarmMsg> msgList)
{
string msg = "";
try
{
// >
// > 参数:
//>> deviceAlarmList : 异常列表Json字符串 `[{"name":"移栽5", "msgKey":"line.move5.timeOut", "msgValue":"运动超时"},{"name":"移栽4", "msgKey":"line.move4.timeOut", "msgValue":"误差过大"}]`
//>>>name : 异常位置名称
//>>>msgKey : 异常信息唯一标识
//>>>msgValue : 异常信息
//>
//> 返回:
//>>` {"code":0,"msg":"ok","data":""}`
//>>
//>> - code: 0为正常,其他为异常,
// >> - msg:消息,
// >> - data:
Dictionary<string, string> paramMap = new Dictionary<string, string>();
string msgListStr = JsonHelper.SerializeObject(msgList);
paramMap.Add("deviceAlarmList", msgListStr);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!