예제 #1
0
        /// <summary>
        /// Gets the id of the external source
        ///
        /// *IDN?
        /// </summary>
        /// <param name="extSource">the EXTSOURCE object</param>
        /// <returns>Id of the external source</returns>
        public void GetExtSrcIDNQuery(IEXTSOURCE extSource)
        {
            bool      found       = false;
            const int timesToFind = 3;

            for (int n = 0; n <= timesToFind; n++)                                   //Giving the external source a certain number of tries to get the right response
            {
                extSource.GetExtSrcIDNQuery();                                       //
                found = utils.GetExtSourceIDInformation(extSource.ExtSrcIDResponse); //Parsing ExtSourceID returns a bool
                if (found)                                                           //If returns true, valid id so a ExtSource is talking back!
                {
                    break;
                }
                Thread.Sleep(1000);
            }
            if (!found) //External source still won't talk back
            {
                Assert.Inconclusive("No External Source Found. ID Response returned " + extSource.ExtSrcIDResponse);
            }
        }