AnsweredAssumed Answered

Query UNTERMINATED and UNTERMINATED for 34405A DMM

Question asked by tsamot on Nov 4, 2010
Latest reply on Nov 9, 2010 by tsamot
A have a problem with VISA programming of 34405A DMM. A have a code as follows:

int main()
{
     ViSession          defaultRM, vi;
     double          res;
     char               buffer[255];

     /* Open session */
     viOpenDefaultRM(&defaultRM);
     viOpen(defaultRM, "USBInstrument1", VI_NULL,VI_NULL, &vi);

     /* Initialize device */
     viPrintf(vi, "*RST\n");                                // resets the multimeter to the Factory configuration
     system_err(vi);
     viPrintf(vi, "SYST:BEEP:STAT OFF\n");        // disables the beeper tone except for errors
     system_err(vi);
     viPrintf(vi, "*CLS");                                   // clears the event registers in all register groups and the Error queue
     system_err(vi);
     
     /* make several identical readings */
     for (int i = 0; i < 7; i++) {
          viPrintf(vi, "MEAS:VOLT:DC? 10,0.01\n");      // range of 10V and resolution  of 0.01V
          viScanf(vi, "%lf", &res);                                // Read results
          printf("Measurement Results: %lf\n", res);     // Print results
          system_err(vi);                                            // Read error if any
     }
     
     /* Close session */
     viPrintf(vi, "SYST:BEEP:STAT ON\n");
     viClose(vi);
     viClose(defaultRM);

     return 0;
}

void system_err(ViSession vi)
{
     char          errBuf[255] = "";

     viPrintf(vi, "SYST:ERR?\n");
     viScanf(vi, "%255t\n", errBuf);
     printf("\tRead: %s\n", errBuf);
     viFlush(vi, VI_READ_BUF);
     viFlush(vi, VI_WRITE_BUF);
}

The output is:
        Read: +0,"No error"
        Read: +0,"No error"
        Read:
Measurement Results: 6.360000
        Read:
Measurement Results: 6.359000
        Read:
Measurement Results: 6.359000
        Read: -410,"Query INTERRUPTED"
Measurement Results: 6.361000
        Read:
Measurement Results: 6.361000
        Read: -420,"Query UNTERMINATED"
Measurement Results: 6.362000
        Read:
Measurement Results: 6.362000
        Read:

I do not understand why it shows Query INTERRUPTED and  Query UNTERMINATED and why if there is no problem is sometimes shows +0,"No error" and sometimes nothing (meaning empty string "").
Can anyone help?  

Outcomes