When I try to measure voltage and current from a PXI 4110 triple-output power supply, the unit resets the output to zero. What is the correct way to do this? Here's the code I'm using to turn on the supply, and subsequently measure its output:
// Turn on PXI 4110 output to voltage and current limit specified.
void PowerOn(ViReal64 voltLevel, ViReal64 currLimit)
{
niDCPower_init(resourceName, VI_FALSE, VI_FALSE, &vi); // Initialize the session
niDCPower_ConfigureVoltageLevel(vi, channelName, voltLevel); // Configure the voltage level
niDCPower_ConfigureCurrentLimit(vi, channelName, NIDCPOWER_VAL_CURRENT_REGULATE, currLimit); // Configure the current limit
niDCPower_ConfigureOutputEnabled(vi, channelName, VI_TRUE); // Enable the output
if (vi != VI_NULL) niDCPower_close (vi);
}
// Measure PXI-4110 6V channel Voltage and Current
// this routine does not work. It turns off the power when run.
PowerMeasure (ViReal64 * voltReadPntr, ViReal64 * currReadPntr)
{
niDCPower_init(resourceName, VI_FALSE, VI_FALSE, &vi); // Initialize the session
niDCPower_Measure (vi, channelName, NIDCPOWER_VAL_MEASURE_CURRENT,
currReadPntr); //measure current, amps
niDCPower_Measure (vi, channelName, NIDCPOWER_VAL_MEASURE_VOLTAGE,
voltReadPntr); // measure voltage
if (vi != VI_NULL) niDCPower_close (vi);
}