AnsweredAssumed Answered

Reading instantneous current and voltage readings reading

Question asked by alok on Mar 25, 2013
Dear fellow members/experts,

I recently came to know that we can programitically access data from E3642A DMM. I am new to VISA API and trying to learn it. 

I find it very usefull if I could programitically read instantaneous current sourced by E3642A. To start with I used samsple c code, doide.c.
where it supply some voltage and read output current. When i modified this code to supply 2.8V, and try to read the current. It fails and does not give any readings, while voltage is set to 3.8V.
Please provide me some idea where I am going wrong.

I have done below modification.

                  voltage = 3.8;
     ErrorStatus = viPrintf(power_supply,"Volt %f\n",voltage);

     /* 500 msec wating for RS-232 port*/
     if(!bGPIB)
         delay(500);
     
     CheckError("Unable to set voltage");

     for(i = 0; i < 10; i++)
     {
          /* Measure output current */
          //ErrorStatus = viPrintf(power_supply,"Measure:Current?\n");
          ErrorStatus = viPrintf(power_supply,"Measure:Current?\n");
          CheckError("Unable to write device");
     
          delay(500); /* Allow output to wait for 500 msec */
     
          /* Retrieve reading */
          //ErrorStatus = viScanf(power_supply,"%lf",&current);
          ErrorStatus = viScanf(power_supply,"%lf",&current);
          
          //CheckError("Unable to read voltage");
          printf("%6.4f\n",current); /* Display diode current */
     }

Thanks & Regards,
Alok Pandey.  

Outcomes