Agilent Technologies E1339A User's And Scpi Programming Manual page 44

72-channel open collector digital output/relay driver module
Table of Contents

Advertisement

Example Program
/* Example: Scanning Channels (72-Channel Mode) */
/*This program scans three channels in 72-channel mode */
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
#define INSTR_ADDR "GPIB-VXI::120::INSTR" /* Agilent E1339A */
long main()
{
ViStatus errStatus;
ViSession viRM;
ViSession E1339;
int ch_first = 100;
int ch_last = 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;}
}
/* logical addr */
/* status from VISA call */
/* Resource Mgr. session */
/* session for E1339A */
/* first scan channel = 100 */
/* last scan channel = 102 */
/* End of main program */
Using the Relay Driver Module
43

Advertisement

Table of Contents
loading

This manual is also suitable for:

Z2309a

Table of Contents