AnsweredAssumed Answered

polling really slow

Question asked by cmontoya on Mar 15, 2010
Latest reply on Mar 22, 2010 by cmontoya
Hello

I am having a hard time with my N9010A. I have configured my device using the IVI drivers. I found polling to be virtually imposable with IVI so I embedded a bit of scpi  just to do the polling.  according to the screen the swept should take ~37ms,  BW=51hz,Span=1khz. yet it takes  ~441ms for me to get my results this test time is killing me. this is all done in CVI, using usb.

This is the polling code:
double MeasureSpectrumAnalyzerPeakN(int avg)
{

                   
                    
                            status|=agmxa_WriteInstrData (saSession, "*CLS\n");

                         
                         status|=agmxa_WriteInstrData (saSession,"*ESE 1\n");
                         Timer();
                         status|=agmxa_WriteInstrData (saSession,"INIT:CONT 0\n");
                         TevSystem_WaitmSec(1);
                         t1=Timer();
                         status|=agmxa_WriteInstrData (saSession,"INIT:IMM\n");
                          TevSystem_WaitmSec(1);
                         status|=agmxa_WriteInstrData (saSession,"*OPC\n");
                         t1=Timer();     
                         TevSystem_WaitmSec(1);
                         c=0;
                         t2=Timer();     
                              while(stat!=1){
                                        status|=agmxa_WriteInstrData (saSession,"*ESR?\n");
                                        status|=agmxa_ReadInstrData (saSession, 3, rstr, &j);
                                   
                                        rstr[4]='\0';
                                        stat=atoi(rstr);
                                        TevSystem_WaitmSec(2);
                                        c++;
                                    }
                         t3=Timer();
                         status |= agmxa_QueryMarker (saSession, &position, &amp);
                         t3=t3-t2;
                         t2=t2-t1;

}

when it's all done
t2=1ms
t3=442ms
c=173
I have also tried using *opc? and removing the *ESR? command it still takes to long     

here is the setup code: rBw=51, frequency=x, attn=20, span=1e3, reflevel=10
          if(gdebug==0){
          status=agmxa_WriteInstrData (saSession,"DISPlay:ENABle OFF\n");
          }
          status |= agmxa_ConfigureMeasurementType (saSession, AGMXA_VAL_MEASURE_TYPE_SA);
          status |= agmxa_ConfigureSweepCoupling (saSession, VI_FALSE, rBw, VI_TRUE, rBw, VI_TRUE, 0.004);
          status |= agmxa_ConfigureAcquisition (saSession, VI_TRUE, 1, VI_FALSE, AGMXA_VAL_DETECTOR_TYPE_NORM,
                                             AGMXA_VAL_VERTICAL_SCALE_LOGARITHMIC);
          status |= agmxa_ConfigureLevel (saSession, AGMXA_VAL_AMPLITUDE_UNITS_DBM, 50.0, refLevel, 0, VI_FALSE, atten);
          status |= agmxa_ConfigureFrequencyCenterSpan (saSession, frequency, span);
          status |= agmxa_ConfigureMarkerEnabled (saSession, VI_TRUE, "1");
          status |= agmxa_SetActiveMarker (saSession, "1");
          status |= agmxa_ConfigureMarkerSearchCharacteristics (saSession, AGMXA_VAL_PEAK_SEARCH_CRITERIA_MAX,
                                                                           VI_TRUE, VI_FALSE, VI_FALSE);
          TevSystem_WaitmSec(75);  



If (you see a way to fix this==TRUE && you post it here==TRUE){
thank you
}
else{
thank you, for looking
}

Outcomes