Software
R&S
®
TS-PSU12
36
User Manual 1504.4524.12 ─ 05
DCPWR_Conf_Ground_Relay ( 0, residDcpwr, "CH1", 0,
&errorOccurred, &errorCode, errorMessage);
/* close the libraries */
SWMGR_Cleanup ( 0, residSwmgr,
&errorOccurred, &errorCode, errorMessage);
DCPWR_Cleanup ( 0, residDcpwr,
&errorOccurred, &errorCode, errorMessage);
RESMGR_Cleanup ( 0, &errorOccurred, &errorCode, errorMessage);
return 0;
}
7.3.2 Programming with device drivers
/*
This example connects channel 1 to the front connector, configures
current limit and voltage, switches the source on and measures the
output current.
Error handling is not considered in this sample in order to
keep it easy to read. The return status should be checked for
VI_SUCCESS after each driver call.
*/
#include "rspsu.h"
int main (int argc, char *argv[])
{
ViSession vi;
ViStatus status;
ViReal64 result;
/*
open a session to the device driver. The resource descriptor
depends on the slot number of the module and must be adapted
to the target system.
*/
status = rspsu_InitWithOptions ("CAN0::0::2::5::INSTR",
VI_TRUE,
VI_TRUE,
"Simulate=0,RangeCheck=1",
&vi);
/* configure channel 1 earth tied */
status = rspsu_ConfigureGround (vi, "CH1", VI_TRUE);
Sample programmes