Exemple #1
0
        public bool GetIn(int _iNo, bool _bDirect = false)
        {
            //Check Error.
            if (_iNo >= m_iMaxIn || _iNo < 0)
            {
                return(false);
            }

            //Get Addr.
            int iBitAddr;
            int iModule;
            int iModuleDp;

            GetInfoInput(_iNo, out iModule, out iModuleDp, out iBitAddr);

            //OutPut
            if (_bDirect)
            {
                uint uiOn = 0;
                CAXD.AxdiReadInportBit(iModule, iBitAddr, ref uiOn);
                return(uiOn == 0 ? false : true);
            }
            else
            {
                bool bRet = ((m_aModuleInfo[iModule].uDataIn >> iBitAddr) & 0x01) == 0x01;
                return(bRet);
            }
        }
Exemple #2
0
 public void input(int moduleNo, int index, out bool value, out bool b)
 {
     try
     {
         if (!isActivate)
         {
             value = false; b = true; return;
         }
         uint v = 0;
         CAXD.AxdiReadInportBit(moduleNo, index, ref v);
         if (v == 0)
         {
             value = false;
         }
         else
         {
             value = true;
         }
         b = true;
     }
     catch
     {
         value = false;
         b     = false;
     }
 }
Exemple #3
0
        private bool InterruptProc(AXT_INTERRUPT_CLASS uClass, int nModuleNo, uint uFlag)
        {
            int    i        = 0;
            int    j        = 0;
            uint   uValue   = 0;
            string strClass = "";
            string strInt   = "";

            switch (uClass)
            {
            case AXT_INTERRUPT_CLASS.KIND_MESSAGE:
                strClass = "Message";
                break;

            case AXT_INTERRUPT_CLASS.KIND_CALLBACK:
                strClass = "Callback";
                break;

            case AXT_INTERRUPT_CLASS.KIND_EVENT:
                strClass = "Event";
                break;
            }

            for (i = 0; i < 4; i++)
            {
                for (j = 0; j < 8; j++)
                {
                    if ((((uFlag >> (i * 8)) >> j) & 0x01) == 0x01)
                    {
                        CAXD.AxdiReadInportBit(nModuleNo, ((i * 8) + j), ref uValue);

                        if (uValue == 0x01)
                        {
                            strInt = String.Format("{0:s} : Rising Int Set Bit {1:X2}", strClass, (i * 8) + j);
                        }
                        else
                        {
                            strInt = String.Format("{0:s} : Falling Int Set Bit {1:X2}", strClass, (i * 8) + j);
                        }


                        if (textInterrupt.TextLength == 0)
                        {
                            textInterrupt.Text += strInt;
                        }
                        else
                        {
                            textInterrupt.Text += "\r\n" + strInt;
                        }


                        textInterrupt.SelectionStart = textInterrupt.TextLength;
                        textInterrupt.ScrollToCaret();
                    }
                }
            }

            return(true);
        }
Exemple #4
0
 public bool IsEmergency()
 {
     if (CAXL.AxlIsOpened() == 1)
     {
         uint value = 0;
         CAXD.AxdiReadInportBit(0, 0, ref value);
         if (value == 1)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }
Exemple #5
0
        public bool GetIn(int _iNo)
        {
            //Check Error.
            if (_iNo >= m_iMaxIn || _iNo < 0)
            {
                return(false);
            }

            //Get Addr.
            int iBitAddr;
            int iModule;
            int iModuleDp;


            GetInfoInput(_iNo, out iModule, out iModuleDp, out iBitAddr);

            //OutPut
            uint uiOn = 0;

            CAXD.AxdiReadInportBit(iModule, iBitAddr, ref uiOn);

            return(uiOn == 0 ? false : true);
        }