Hi, crystal,
a few comments and questions concerning your code
//==========================================================================
// INIT PS, Reset device
//==========================================================================
OutputStatus("Initiating PS Simulator...");
HelloPanelOn("PS Operation","Initiating PS simulator...");
// CheckPsError(hpe363xa_init ("GPIB::5::%d", VI_TRUE, VI_TRUE, &PS_GPIB_ADDR_handle));
It seems that you did try to use the National Instruments Instrument driver for the E363x series here.
But this doesn't work, because you didn't setup the Resource Name right.
CheckPsError(Power_Supply_Init (g_vPsGpibAddr, VI_TRUE, VI_TRUE, &g_vPsHandle));
CheckPsError(Power_Supply_OnOff (g_vPsHandle, g_vVoltage, 3.00, VI_TRUE));
CheckPsError(Power_Supply_Set ( g_vPsHandle, g_vinstrument, 3.8));
CheckPsError(Power_Supply_Set_Current (g_vPsHandle, g_vinstrument, 3.00));
What driver/library are you using here ? Does it really support the E3631A ? The E3631A is different to the other E363x series supplies, because it has 3 voltage outputs. And this driver seems to lack the ability of setting up more than one output , because these is no option to choose the output.
Here a snippet of code were are using build upon a version of the NI Instrument driver. Probably you want to adapt the error handling to your needs.
// Initialize PS_P24V
Fmt(resource_id,"GPIB::%d[w2]::INSTR",addr_PS_P24V);
status = hpe363xa_init (resource_id, VI_TRUE, VI_TRUE,
&Instr_Handle_PS_P24V);
if ( status ) {
error = status ;
status = hpe363xa_error_message (Instr_Handle_PS_P24V, error, errMsg);
goto Error;
}
// Specify Output of Power Supply P24V
status = hpe363xa_reset (Instr_Handle_PS_P24V);
if ( status ) {
error = status ;
status = hpe363xa_error_message (Instr_Handle_PS_P24V, error, errMsg);
goto Error;
}
status = hpe363xa_ConfigureVoltageLevel (Instr_Handle_PS_P24V, ps_channel, 24.0);
if ( status ) {
error = status ;
status = hpe363xa_error_message (Instr_Handle_PS_P24V, error, errMsg);
goto Error;
}
// status = hpe363xa_outputOn (Instr_Handle_PS_P24V, hpe363xa_OUTPUT_ON);
status = hpe363xa_ConfigureOutputEnabled (Instr_Handle_PS_P24V, ps_channel,
VI_TRUE);
if ( status ) {
error = status ;
status = hpe363xa_error_message (Instr_Handle_PS_P24V, error, errMsg);
goto Error;
}
status = hpe363xa_Measure (Instr_Handle_PS_P24V, ps_channel,
HPE363XA_VAL_MEASURE_VOLTAGE,
&voltage_PS24);
if ( status ) {
error = status ;
status = hpe363xa_error_message (Instr_Handle_PS_P24V, error, errMsg);
goto Error;
}
status = hpe363xa_Measure (Instr_Handle_PS_P24V, ps_channel,
HPE363XA_VAL_MEASURE_CURRENT,
¤t_PS24);
if ( status ) {
error = status ;
status = hpe363xa_error_message (Instr_Handle_PS_P24V, error, errMsg);
goto Error;
}