<span style="font-size:11pt;"><span style="font-family:Calibri,sans-serif;"><span style="font-size:12.0pt;"><span style="font-family:"Verdana",sans-serif;">Hello,<br>
<br>
We are using a MSO44 scope and we are trying to capture the time delay between channels 1 and 2.<br>
We are trying to get the average delay from 100 samples.<br>
What we found is that if we do not put in a Thread.Sleep <strong>(highlighted) </strong>of at least 300ms, a number of samples in the beginning are 9.91E37 and the rest of the samples are good. Also when reading the ESR register, we are seeing a 0x32 or command error. We don't know why.<br>
Our code snippet to get the time delay is shown below:               <br>
<br>
<br>
                _device.Write(":STOP");<br>
                _device.Write(_s.SR_CLEAR_MEASURE);<br>
<br>
                //_device.Write(_s.SR_READ_EVENT_STATUS_REG);<br>
<br>
                //temp = _device.ReadString();<br>
                //tmp = Convert.ToUInt32(temp);<br>
                //Logger.ToSystem("ESR Stat: 0x" + tmp.ToString("X2"));<br>
               <br>
<br>
                _device.Write(":RUN");<br>
<br>
<br>
                _device.Write("MEASUREMENT:DELETE \"MEAS1\"");<br>
                _device.Write("MEASUrement:MEAS1:TYPE DELAY");<br>
                _device.Write("MEASUrement:MEAS1:SOUrce1 CH1");<br>
                _device.Write("MEASUrement:MEAS1:SOUrce2 CH2");<br>
<br>
                <strong>Thread.Sleep(1000); //1 sec delay bad data, 3 sec delay good data </strong><br>
<br>
                //_device.Write(_s.SR_READ_EVENT_STATUS_REG);<br>
<br>
                //temp = _device.ReadString();<br>
                //tmp = Convert.ToUInt32(temp);<br>
                //Logger.ToSystem("ESR Stat: 0x" + tmp.ToString("X2"));<br>
<br>
                _device.Write("MEASUrement:MEAS1:RESUlts:CURRentacq:MEAN?");<br>
                temp = RemoveCommonEscapeSequences(_device.ReadString());<br>
<br>
                int numavg = 100;<br>
                for (int i = 0; i < numavg; i++)<br>
                {<br>
                    _device.Write("MEASUrement:MEAS1:RESUlts:CURRentacq:MEAN?");<br>
                    temp = RemoveCommonEscapeSequences(_device.ReadString());<br>
<br>
                    Logger.ToSystem("Delay #" + (i+1).ToString() + ": " + temp);<br>
<br>
                    double delay = Convert.ToDouble(temp);<br>
                    // total += delay * 1e+9; // Convert to ns<br>
                    total += delay; // Convert to ns<br>
                }</span></span></span></span><br>