AnsweredAssumed Answered

N6951A timeout reading out elog

Question asked by jonnyx on May 4, 2018

Hi,

 

i have difficulties when trying to read out the elog buffer from my N6951A power supply into my C++ program.

i am monitoring the communication via the Keysigth IO Monitor where the viQuery results in VI_ERROR_TMO

 

when reading out the error register afterwards, also via the interactiveIO tool, always those two errors appear:

 

+303,"There is not a valid acquisition to fetch from"

-420, "Query UNTERMINATED"

 

 

here is how i initialize my keysight for elogging:

    viPrintf(N6951A, (ViString)"*RST\n");
    viPrintf(N6951A, (ViString)":FORMat:DATA %s\n", (ViString)"ASCii");
    viPrintf(N6951A, (ViString)":SENSe:ELOG:PERiod %@3lf\n", elogPeriod_);  //0.002 = 2ms 
    viPrintf(N6951A, (ViString)":SENSe:ELOG:FUNCtion:CURRent %@1d\n", 1);
    viPrintf(N6951A, (ViString)":SENSe:ELOG:FUNCtion:VOLTage %@1d\n", 1); 
    viPrintf(N6951A, (ViString)":TRIGger:ELOG:SOURce %s\n", (ViString)"IMMediate");
    viPrintf(N6951A, (ViString)":SOURce:VOLTage:LEVel:IMMediate:AMPLitude %@3lf\n", outputVoltage_);
    viPrintf(N6951A, (ViString)":SOURce:CURRent:LEVel:IMMediate:AMPLitude %@3lf\n", outputCurrentLimit_);
    viPrintf(N6951A, (ViString)":OUTPut:STATe %@1d\n", 1);                                                   
    viPrintf(N6951A, (ViString)":INITiate:ELOG\n");

when i want to start my measurements, i send the command
    viPrintf(N6951A, (ViString)":TRIGger:ELOG:IMMediate\n");
and afterwards, a timer is started, which triggers reading out the buffer every 500ms.

so: after receiving the "TRIGger:ELOG:IMMediate\n"command, the buffer is read out at time t>=500ms
for the first time.and this code has been working sometimes, after i manually did a reset of the
keysight via a RST command before running my program again

this is how the query looks like, and i got it out of the Command Expert from Keysight.
    if(VI_SUCCESS == viQueryf(N6951A, ":FETCh:ELOG? %@1d\n", "%,#lf", dataFetchSizeMax_, &elogSize_, elog_)){ //datafetchsizemax = 500, elogSize_=500
       for(int i = 0; i<elogSize_; i++){
            keysightMeasurements_->current.push_back(elog_[i]);
            keysightMeasurements_->voltage.push_back(elog_[++i]);
        }
    }


Does anyone have an idea why i am getting the +303 and -420 error?

Thanks for any help!

Outcomes