AnsweredAssumed Answered

Timeout when making measurement using N5531

Question asked by Superbrew on Jan 9, 2008
Latest reply on Mar 17, 2008 by jborges3
I am trying to make some RFP measurements over GPIB with the N5531. I am using a N1911 for the power meter. My program will work fine for most measuremnts but I get timeout error messages at random times when trying to read back the data from the N5531. For example, using this code in C#:

for &#40;; testfreq <= 2.4; testfreq += .2&#41;
                &#123;
                    freqset = "CW" + Convert.ToString&#40;testfreq&#41; + "GZ";

                    if &#40;testfreq < .1&#41;
                    &#123;
                        testfreq = 0;
                    &#125;

                    GPIB.SwpOsc.WriteString&#40;freqset&#41;;
                    while &#40;msmrmnt < 10&#41;
                    &#123;
                        pwrset = "PL" + Convert.ToString&#40;testpower&#41; + "DM";
                        GPIB.SwpOsc.WriteString&#40;pwrset&#41;;
                        Thread.Sleep&#40;4000&#41;;
                        GPIB.Specan.WriteString&#40;"READ:RFP?"&#41;;
                        Thread.Sleep&#40;500&#41;;
                        msmrmntStr = GPIB.Specan.ReadString&#40;128&#41;;
                        msmrmntStr = msmrmntStr.Remove&#40;16&#41;;
                        msmrmnt = Convert.ToDouble&#40;msmrmntStr&#41;;
                        testpower += .3;


I get the timeout error at random frequencies. What am I doing wrong? I am not sure how to properly implement *OPC, if I can get some help with that I would appreciate it. Thanks  

Outcomes