Programming the RF Switch 23
Chapter 2
Example: Closing a
Signal Path
This program example closes a signal path from COM 01 to channel 010
and verifies that the path is closed.
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
void err_handler();
void main()
{
int ch_closed;
/* Create and open a device session, E1470 is at logical address 120 */
ViStatus err;
ViSession defaultRM,rf_mux;
ViOpenDefaultRM (&defaultRM);
viOpen (defaultRM,"GPIB-VXI0::9::120",VI_NULL,VI_NULL,&rf_mux);
/* Close a path from COM 01 to channel 010 */
err= viPrintf (rf_mux,"PATH:COMM 01,011\n");
if (err < VI_SUCCESS) err_handler (rf_mux,err);
/* Verify the path closure */
err = viPrintf (rf_mux,"PATH:COMM? 01,011\n");
if (err < VI_SUCCESS) err_handler (rf_mux,err);
err = viScanf (rf_mux,"%d",&ch_closed);
if (err < VI_SUCCESS) err_handler (rf_mux,err);
if (ch_closed == 1) printf ("Signal path is closed");
else printf ("Signal path is NOT closed");
/* Close the session */
viClose (rf_mux);
viClose (defaultRM);
}
void err_handler() /* Error handling routine */
{
ViStatus err;
char err_msg[1024]={0};
viStatusDesc(rf_mux,err,err_msg);
printf ("Error = %s\n",err_msg);
return;
}
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание E1470A Series
Страница 3: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 9: ...8 Notes Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 59: ...Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...