Example #1
0
 public bool GetBreakOff(int _iMotrNo)
 {
     if (_iMotrNo < 0 || _iMotrNo >= m_iMaxMotr)
     {
         Log.ShowMessageFunc(string.Format("ERR Motr{0} is not Between 0 and {1}", _iMotrNo, m_iMaxMotr));
         return(false);
     }
     return(Dio.GetY(Para[_iMotrNo].iBreakOffAdd));
 }
Example #2
0
        public void Reset()
        {
            TimeOutFwd.Clear();
            TimeOutBwd.Clear();

            //Set exist ID.
            bool bExistFwdX = (Para.iFwdXAdd >= 0);
            bool bExistBwdX = (Para.iBwdXAdd >= 0);
            bool bExistFwdY = (Para.iFwdYAdd >= 0);
            bool bExistBwdY = (Para.iBwdYAdd >= 0);

            bool bFwdX = false;
            bool bBwdX = false;
            bool bFwdY = false;
            bool bBwdY = false;

            bool bVtrlFwdX = false;
            bool bVtrlBwdX = false;

            //bool bVtrlFwdY = false;
            //bool bVtrlBwdY = false;

            //I/O.
            if (bExistFwdX)
            {
                bFwdX = GetFwdX();             //IO.GetX(Para.iFwdXAdd,true); //Detect X/Y Val.
            }
            if (bExistBwdX)
            {
                bBwdX = GetBwdX();             //IO.GetX(Para.iBwdXAdd,true);
            }
            if (bExistFwdY)
            {
                bFwdY = DIO.GetY(Para.iFwdYAdd);
            }
            if (bExistBwdY)
            {
                bBwdY = DIO.GetY(Para.iBwdYAdd);
            }

            //Virtual Input Sensor
            if (bExistFwdX)
            {
                bVtrlFwdX = bFwdX;
            }
            else if (bExistBwdX)
            {
                bVtrlFwdX = !bBwdX;
            }
            else if (bExistFwdY)
            {
                bVtrlFwdX = bFwdY;
            }
            else if (bExistBwdY)
            {
                bVtrlFwdX = !bBwdY;
            }


            if (bExistBwdX)
            {
                bVtrlBwdX = bBwdX;
            }
            else if (bExistFwdX)
            {
                bVtrlBwdX = !bFwdX;
            }
            else if (bExistBwdY)
            {
                bVtrlBwdX = bBwdY;
            }
            else if (bExistFwdY)
            {
                bVtrlBwdX = !bFwdY;
            }


            if (bVtrlFwdX)
            {
                Stat.eCmdPos = EN_CYL_POS.Fwd;
            }
            if (bVtrlBwdX)
            {
                Stat.eCmdPos = EN_CYL_POS.Bwd;
            }
        }