Example #1
0
        //****************************************//
        //              Micro Switch              //
        //****************************************//
        public bool ReadMicroSwitch()
        {
            bool wellClosed = false;

            string wellNumber;

            if (currWell == 1)
            {
                wellNumber = "0";
            }
            else
            {
                wellNumber = "3";
            }

            string old_wellSwitch = m_Agilent.ReadBit("103", wellNumber);

            while (!(readMicroSwitchStop | wellClosed))
            {
                string wellSwitch = m_Agilent.ReadBit("103", wellNumber);

                if ((old_wellSwitch == "1") && (wellSwitch == "0"))
                {
                    wellClosed = true;
                    return(true);
                }

                old_wellSwitch = wellSwitch;

                System.Threading.Thread.Sleep(100);
            }
            return(false);
        }