Software
R&S
®
TS-PSM2
26
User Manual 1178.2773.02 ─ 01
int main (int argc, char *argv[])
{
long residSwmgr; /* resource ID for switch manager library */
short errorOccurred = 0;
long errorCode = 0;
char errorMessage [GTSL_ERROR_BUFFER_SIZE] = "";
/* load the physical and application configuration files */
RESMGR_Setup ( 0, "physical.ini", "Psm2Application.ini",
&errorOccurred, &errorCode, errorMessage);
/* initialize the switch manager library */
SWMGR_Setup ( 0, "bench->switch", &residSwmgr,
&errorOccurred, &errorCode, errorMessage);
/* connect channel 1 to local power bus A */
SWMGR_Connect ( 0, residSwmgr, "CH1", "LPBA",
&errorOccurred, &errorCode, errorMessage);
/* connect channel 1 to local front connector */
SWMGR_Connect ( 0, residSwmgr, "CH1", "CH1_1",
&errorOccurred, &errorCode, errorMessage);
/* connect channel 1 to local analog bus lines */
SWMGR_Connect ( 0, residSwmgr, "CH1_HI", "LABa1",
&errorOccurred, &errorCode, errorMessage);
SWMGR_Connect ( 0, residSwmgr, "CH1_LO", "LABa2",
&errorOccurred, &errorCode, errorMessage);
/* connect local analog bus lines to analog bus line on backplane */
SWMGR_Connect ( 0, residSwmgr, "LABa1", "ABa1",
&errorOccurred, &errorCode, errorMessage);
SWMGR_Connect ( 0, residSwmgr, "LABa2", "ABa2",
&errorOccurred, &errorCode, errorMessage);
/* wait until relays have settled; timeout 500 ms */
SWMGR_WaitForDebounce ( 0, residSwmgr, 500,
&errorOccurred, &errorCode, errorMessage);
/* disconnect channel 1 from local front connector */
SWMGR_Disconnect ( 0, residSwmgr, "CH1", "CH1_1",
&errorOccurred, &errorCode, errorMessage);
/* wait until relays have settled; timeout 500 ms */
SWMGR_WaitForDebounce ( 0, residSwmgr, 500,
&errorOccurred, &errorCode, errorMessage);
/* disconnect the rest */
Software R&S TS-PSM2