示例#1
0
        /// <summary>
        /// Waits for the external source to complete in a matter of seconds
        ///
        /// *OPC?
        /// </summary>
        /// <param name="extSource">the EXTSOURCE object</param>
        /// <param name="timeLimit">How long to wait for the OPC to return</param>
        /// <returns>OPC result</returns>
        public void WaitForTimelimitExternalSource(IEXTSOURCE extSource, string timeLimit)
        {
            uint seconds = uint.Parse(timeLimit);
            uint timeout = seconds * 1000; // Convert to milliseconds

            extSource.GetExtSrcOPCQuery(timeout);
            Assert.AreEqual("1", extSource.ExtSrcOPC, "*OPC? query failed! Error was: " + extSource.ExtSrcOPC);
        }
示例#2
0
 /// <summary>
 /// Waits for the external source to complete using default timeout(15 seconds)
 ///
 /// *OPC?
 /// </summary>
 /// <param name="extSource">the EXTSOURCE object</param>
 /// <returns>OPC result</returns>
 public void WaitForExternalSource(IEXTSOURCE extSource)
 {
     extSource.GetExtSrcOPCQuery();
     Assert.AreEqual("1", extSource.ExtSrcOPC, "*OPC? query failed! Error was: " + extSource.ExtSrcOPC);
 }