24 Programming the RF Switch
Chapter 2
Example: Opening
and Closing Signal
Paths
This program first closes a signal path from COM 01 to channel 011 and
verifies that the path is closed. Next, the program closes a signal path from
COM 02 to channel 010 (which opens the COM 01 to channel 011 path).
Then, the program verifies that the COM 02 to channel 010 path is closed
and the COM 01 to channel 011 path is open.
#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 011 */
err= viPrintf (rf_mux,"PATH: COMM 01,011\n");
if (err < VI_SUCCESS) err_handler (rf_mux,err);
/* Verify 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 01,011 is closed");
else printf ("Signal path 01,011 is NOT closed");
/* Close a second signal path COM02 to channel 010 */
err = viPrintf (rf_mux,"PATH:COMM 02,01\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 01,011 is closed");
else printf ("Signal path 01,011 is NOT closed");
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...