|
|
@ -638,6 +638,7 @@ bool CTrackWorkFlow::SendMsgToPlc(ETrackPlcCmd PlcCmd, bool bStopReadMsg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char * buf = Msg.GetBuffer();
|
|
|
|
char * buf = Msg.GetBuffer();
|
|
|
|
int len = Msg.GetLength();
|
|
|
|
int len = Msg.GetLength();
|
|
|
|
|
|
|
|
m_TrackCOM.ClearCache();
|
|
|
|
m_TrackCOM.WriteBuf(buf, len);//发送
|
|
|
|
m_TrackCOM.WriteBuf(buf, len);//发送
|
|
|
|
//gLogMgr->WriteDebugLog("SendMsgToPlc==>" + Msg);
|
|
|
|
//gLogMgr->WriteDebugLog("SendMsgToPlc==>" + Msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -690,9 +691,9 @@ bool CTrackWorkFlow::PushJigOut()
|
|
|
|
SendMsgToPlc(PlcCmd, false);
|
|
|
|
SendMsgToPlc(PlcCmd, false);
|
|
|
|
m_bPushJigOut = false;
|
|
|
|
m_bPushJigOut = false;
|
|
|
|
int cnt = 0;
|
|
|
|
int cnt = 0;
|
|
|
|
while (cnt < 50 && (!m_bPushJigOut))
|
|
|
|
while (cnt < 200 && (!m_bPushJigOut))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Sleep(200);
|
|
|
|
Sleep(100);
|
|
|
|
cnt++;
|
|
|
|
cnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cnt == 200)
|
|
|
|
if (cnt == 200)
|
|
|
@ -710,7 +711,7 @@ bool CTrackWorkFlow::IsJigOK()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
//return true;
|
|
|
|
ETrackPlcCmd PlcCmd;
|
|
|
|
ETrackPlcCmd PlcCmd;
|
|
|
|
PlcCmd = _ETrack_PlcCmd_Check_Jig_In;
|
|
|
|
PlcCmd = _ETrack_PlcCmd_Check_Jig_In;
|
|
|
|
|
|
|
|
|
|
|
@ -1305,12 +1306,9 @@ void CTrackWorkFlow::UnLoad()
|
|
|
|
logstr.Format("等待[下料机] 运动至[%s]下载具位.", str);
|
|
|
|
logstr.Format("等待[下料机] 运动至[%s]下载具位.", str);
|
|
|
|
gLogMgr->WriteDebugLog(logstr);
|
|
|
|
gLogMgr->WriteDebugLog(logstr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ((!m_bPushJigReady) )
|
|
|
|
//int cnt = 0;
|
|
|
|
|
|
|
|
while ((!m_bPushJigReady) )//&& cnt < 400)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Sleep(300);
|
|
|
|
Sleep(300);
|
|
|
|
//cnt++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*if (cnt == 400)
|
|
|
|
/*if (cnt == 400)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1327,8 +1325,7 @@ void CTrackWorkFlow::UnLoad()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetCurTrackWorkStep(_ETrack_Step_Unload_Err);
|
|
|
|
SetCurTrackWorkStep(_ETrack_Step_Unload_Err);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Sleep(500);
|
|
|
|
|
|
|
|
if (gProgram_SZ_XL->SendMsgToLoadDevice(m_TrackType, _ETrack_Step_PushOut_Finished, true) == false)
|
|
|
|
if (gProgram_SZ_XL->SendMsgToLoadDevice(m_TrackType, _ETrack_Step_PushOut_Finished, true) == false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SetCurTrackWorkStep(_ETrack_Step_Unload_Err);
|
|
|
|
SetCurTrackWorkStep(_ETrack_Step_Unload_Err);
|
|
|
@ -1336,7 +1333,6 @@ void CTrackWorkFlow::UnLoad()
|
|
|
|
gLogMgr->WriteDebugLog(Log);
|
|
|
|
gLogMgr->WriteDebugLog(Log);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Sleep(500);
|
|
|
|
|
|
|
|
//平台移动到 送回空治具的位置
|
|
|
|
//平台移动到 送回空治具的位置
|
|
|
|
MoveToPos(_ETrack_Step_WaitBack);
|
|
|
|
MoveToPos(_ETrack_Step_WaitBack);
|
|
|
|
gProgram_SZ_XL->SendMsgToLoadDevice(m_TrackType, _ETrack_Step_WaitBack, true);//告诉下料机,我已到可回治具位
|
|
|
|
gProgram_SZ_XL->SendMsgToLoadDevice(m_TrackType, _ETrack_Step_WaitBack, true);//告诉下料机,我已到可回治具位
|
|
|
|