예제 #1
0
        bool CycleLotStart(ref TCycle _tCycle)
        {
            //Check Cycle Time Out.
            string sTemp;

            if (_tCycle.tmCycle.OnDelay(_tCycle.iStep == _tCycle.iPreStep && !OM.MstOptn.bDebugMode, 8000))
            {
                SM.ER_SetNeedShowErr(false);
                sTemp = string.Format("VisionTimeOut Step={0:00}", _tCycle.iStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                SM.IO_SetY(yi.VISN_Change, false);
                _tCycle.iStep = 0;
                return(true);
            }

            if (_tCycle.iStep != _tCycle.iPreStep)
            {
                sTemp = string.Format("Step={0:00}", _tCycle.iStep);
                Log.Trace("Vision Communction", sTemp);
            }

            _tCycle.iPreStep = _tCycle.iStep;

            //Cycle.
            switch (_tCycle.iStep)
            {
            default:
                sTemp = string.Format("DEFAILT END STATUS Step={0:00} , PreStep={0:00}", _tCycle.iStep, _tCycle.iPreStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                Log.Trace("Vision Communction", sTemp);
                SM.IO_SetY(yi.VISN_Change, false);
                _tCycle.iStep = 0;
                return(true);

            case 10:
                SM.IO_SetY(yi.VISN_LotStart, false);
                _tCycle.iStep++;
                return(false);

            case 11:
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                SM.IO_SetY(yi.VISN_LotStart, true);
                _tCycle.iStep++;
                return(false);

            case 12:
                if (!SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                SM.IO_SetY(yi.VISN_LotStart, false);
                _tCycle.iStep++;
                return(false);

            case 13:
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                _tCycle.iStep = 0;
                return(true);
            }
        }
예제 #2
0
        //One Cycle.
        //여기부터.
        bool CycleInsp(ref TCycle _tCycle)
        {
            //Check Cycle Time Out.
            string sTemp;

            if (_tCycle.tmCycle.OnDelay(_tCycle.iStep == _tCycle.iPreStep && !OM.MstOptn.bDebugMode, 8000))
            {
                SM.ER_SetNeedShowErr(false);
                sTemp = string.Format("VisionTimeOut Step={0:00}", _tCycle.iStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                _tCycle.iStep = 0;
                return(true);
            }

            if (_tCycle.iStep != _tCycle.iPreStep)
            {
                sTemp = string.Format("Step={0:00}", _tCycle.iStep);
                Log.Trace("Vision Communction", sTemp);
            }

            _tCycle.iPreStep = _tCycle.iStep;

            //Cycle.
            switch (_tCycle.iStep)
            {
            default:
                sTemp = string.Format("DEFAILT END STATUS Step={0:00} , PreStep={0:00}", _tCycle.iStep, _tCycle.iPreStep);
                SM.ER_SetErr(ei.VSN_ComErr, sTemp);
                Log.Trace("Vision Communction", sTemp);
                _tCycle.iStep = 0;
                return(true);

            case 10:
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                //SML.MT.OneShotTrg((int)mi.TOOL_YTool,true,1000);
                //SM.IO_SetY(Para.yVisn_ManInsp, true);
                SM.IO_SetY(yi.VISN_ManInsp, true);
                Log.Trace("Vision Shot", "ON");
                _tCycle.tmDelay.Clear();
                _tCycle.iStep++;
                return(false);

            case 11:
                //if(_tCycle.tmDelay.OnDelay(true, 10))return false;
                if (!SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                //SM.IO_SetY(Para.yVisn_ManInsp, false);
                SM.IO_SetY(yi.VISN_ManInsp, false);
                Log.Trace("Vision Shot", "OFF");
                _tCycle.tmDelay.Clear();
                _tCycle.iStep++;
                return(false);

            case 12:
                //if(_tCycle.tmDelay.OnDelay(1000))return false;
                //SM.IO_SetY(Para.yVisn_ManInsp, false);
                _tCycle.tmDelay.Clear();
                _tCycle.iStep++;
                return(false);

            case 13:
                //if(_tCycle.tmDelay.OnDelay(1000))return false;
                //if(SM.IO_GetY(Para.yVisn_ManInsp))
                //{
                //SM.IO_SetY(yi.VISN_ManInsp, false);
                Log.Trace("Vision Shot", "OFF2");
                //return false;
                //}
                if (SM.IO_GetX(xi.VISN_Busy))
                {
                    return(false);
                }
                Log.Trace("Vision Shot", "END");
                _tCycle.iStep = 0;
                return(true);
            }
        }