AnsweredAssumed Answered

E4416A remote "FETCH"

Question asked by thesoothsayer on Oct 26, 2009
Latest reply on Oct 27, 2009 by thesoothsayer
I'm connecting an Agilent E4416A power meter with a E9301A sensor to my PC using a NI GPIB-USB-HS.
I've a question about the "FETCH" command using "REAL" mode (64-bit floating point number).


                viPrintf(viSA,"*CLS\n");

     viPrintf(viSA,"*RST\n");
                 viPrintf(viSA,"SENS:FREQ 422.6MHZ\n");

     viPrintf(viSA,"SENS:POW:AC:RANG 0\n"); /* Sets sensor to lower range */
     
     viPrintf(viSA,"SENS:MRATE FAST\n"); /* FAST measurement mode */

     viPrintf(viSA,"INIT:CONT ON\n"); /* Free run mode */

     viPrintf(viSA,"TRIG:SOUR IMM\n"); /* Free run mode */

     viPrintf(viSA,"CAL1:ZERO:AUTO ONCE\n"); /* Calibrates the sensor to zero input */

     Sleep(30000);

     viPrintf (viSA,"FETCH?\n");          
     viRead (viSA,(ViBuf)sBuffer,80,&lLength);
     sBuffer[lLength] = 0;                    
     printf("%s\n",sBuffer);                
     viPrintf (viSA,"FETCH?\n");          
     viRead (viSA,(ViBuf)sBuffer,80,&lLength);
     sBuffer[lLength] = 0;                   
     printf("%s\n",sBuffer);                  
     
     viPrintf(viSA,"FORM REAL\n"); /* 64-bit format */


     viPrintf(viSA,"FORM:BORD SWAP\n"); /* Byte order swapping */


The result from the ASCII mode seems to be correct, but how do I fetch the data in the REAL format?

I've tried

viQueryf(viSA,"FETCH?\n", "%lf", &value);     

and
          viPrintf(viSA,"FETCH?\n");
          viScanf(viSA,"%lf", &value);


but both return 0. However, typing FETCH? in the Agilent Interactive IO returns:
-> FETC?
<- ?L?«x0E»?j??
-> FETC?
<- ?Q{?{?k?


Which seems to indicate that it is returning something.

What am I missing? Thanks.  

Outcomes