Software
R&S
®
TS-PSM4
30
User Manual 1178.2796.02 ─ 01
#include <ansi_c.h>
#include <userint.h>
#include "resmgr.h"
#include "route.h"
#include "dmm.h"
#include "rspsm4.h"
int main (int argc, char *argv[])
{
long residRoute; /* resource ID for signal routing library */
long residDmm; /* resource ID for dmm library */
short errorOccurred = 0;
long errorCode = 0;
char errorMessage [GTSL_ERROR_BUFFER_SIZE] = "";
double voltageResult = 0.0;
double currentResultLoadActive = 0.0;
double currentResultLoadStandby = 0.0;
int resultsCount = 0;
ViSession psm4SessionHandle = -1;
/* load the physical and application configuration files */
RESMGR_Setup ( 0, "physical.ini", "application.ini",
&errorOccurred, &errorCode, errorMessage);
/* initialize the signal routing library */
ROUTE_Setup ( 0, "bench->psm4SampleApp", &residRoute,
&errorOccurred, &errorCode, errorMessage);
/* initialize the dmm library */
DMM_Setup ( 0, "bench->psm4SampleApp", &residDmm,
&errorOccurred, &errorCode, errorMessage);
/* close coupling relays to TS-PCA3 Analog Bus */
DMM_Conf_Coupling_Relays ( 0, residDmm, 1,
&errorOccurred, &errorCode, errorMessage);
/* set dmm function, resolution and auto ranging */
DMM_Conf_Measurement ( 0, residDmm, "DC_VOLTS", 0.0, "AUTO_RANGE_ON",
1.0e-4,
&errorOccurred, &errorCode, errorMessage);
Programming with GTSL Libraries