Using the Relay Driver Module
45
Example Program
/*
Example: Scanning Channels (36-Channel Mode)
*/
/*This program scans three channels in 36-channel mode */
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
#define INSTR_ADDR "GPIB-VXI::120::INSTR"
/* 120 is E1339A */
/*logical addr */
long main()
{
ViStatus errStatus;
/* status from VISA call */
ViSession viRM;
/* Resource Mgr. session */
ViSession E1339;
/* session for E1339A */
int ch_first = 100;
/* first scan channel = 100 */
int ch_last = 102;
/* last scan channel = 102 */
/*
Open a default Resource Manager
*/
errStatus = viOpenDefaultRM (&viRM);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpenDefaultRM() returned 0x%x\n",errStatus);
return errStatus;}
/*
Open the Instrument Session
*/
errStatus = viOpen (viRM, INSTR_ADDR,VI_NULL,VI_NULL, &E1339);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpen() returned 0x%x\n",errStatus);
return errStatus;}
/*
Close Channels 0 -2 SET, Open Channels 0 - 2 RESET
*/
errStatus = viPrintf (E1339, "SCAN (@%d:%d);INIT\n",ch_first,ch_last);
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
return errStatus;}
/*
Close Sessions
*/
errStatus = viClose (E1339);
if (VI_SUCCESS > errStatus){
printf("ERROR: viClose() returned 0x%x\n",errStatus);
return 0;}
errStatus = viClose (viRM);
if (VI_SUCCESS > errStatus){
printf("ERROR: viClose() returned 0x%x\n",errStatus);
return 0;}
}
/* End of main program */
Содержание E1339A
Страница 2: ......
Страница 3: ......
Страница 11: ...10 Notes ...
Страница 12: ...11 Notes ...
Страница 13: ...12 Notes ...
Страница 21: ...20 Getting Started ...
Страница 47: ...46 Using the Relay Driver Module ...
Страница 81: ...80 Relay Driver Module Command Reference Figure 5 1 Relay Driver Module Status System Register Diagram GPIB ...
Страница 95: ...94 Relay Driver Specifications ...
Страница 103: ...102 Relay Driver Register Definitions ...
Страница 109: ...108 Index ...