06-26-2013 02:09 PM
I'm interfacing with an Agilent 34411a DMM and an Agilent power supply via GPIB, using the drivers from the NI website. I'm trying to output a voltage with the supply, then take a multipoint reading with the DMM. The power supply works as intended, but the dmm does not. Here's my code:
int e1 = hp34401a_ConfigureMeasurement(dmm, HP34401A_VAL_DC_VOLTS, HP34401A_VAL_AUTO_RANGEON, 0.0001);
int e2 = hp34401a_ConfigureTrigger(dmm, HP34401A_VAL_IMMEDIATE, 10 * resLoad * capEst);
int e3 = hp34401a_ConfigureMultiPoint(dmm, 1000, 1000, HP34401A_VAL_INTERVAL, resLoad *capEst / 100);
int e4 = hpe363xa_ConfigureAllOutputEnabled(supply, VI_TRUE);
int e5 = hpe363xa_ConfigureVoltageLevel(supply, "2", capMax);
int actual;
int e6 = hp34401a_ReadMultiPoint (dmm, HP34401A_VAL_MAX_TIME_INFINITE, 1000, capSamples, actual);
int e7 = hpe363xa_ConfigureVoltageLevel(supply, "2", 0.0);
Here, resLoad and capEst are a resistance and a capacitance in the circuit I'm testing. So my process is to configure the DMM to measure DC voltage, give it a delay of 10 time constants for the circuit to fully discharge before triggering, then (after increasing the supply voltage from 0V) configure it so that it takes 1000 measurements spaces 1/100 of a time constant apart. The configuration functions don't return any error codes, but hp34401a_ReadMultiPoint()
returns an error code of 0xBFFA2003
, an IVI error, according to the driver. In addition, the value of actual
is 0, meaning no data has been acquired, and array capSamples
is empty.
I think I've called some of these functions incorrectly, given the sparse documentation. Any help would be greatly appreciated.
06-26-2013 02:11 PM
Would this have better luck in the hardware forums?
06-27-2013 04:40 PM
Hello raghavs511,
It looks like you were not allocating the correct amount of memory for the measurement array and were not passing the actualpoint parameter by reference.
Try the attached multipoint example which I threw together.
06-27-2013 04:46 PM
Thanks. I actually solved the problem by passing the multipointer by reference, initializing the sample array as static double samples[1000]
, and using low level calls instead of ReadMultiPoint.
Thanks again!