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

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

Advertisement

Example Program
/* Example: Scanning Using Trig Out and Event In Ports */
/*This example uses the Trig Out and Event In ports to synchronize Relay */
/*Driver switch channel closures to an external measurement device */
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
#define INSTR_ADDR1 "GPIB-VXI::120::INSTR" /120 is * E1339A */
#define INSTR_ADDR2 "GPIB-VXI::22::INSTR" /* 22 is Ext Instrument */
long main()
{
ViStatus errStatus;
ViSession viRM;
ViSession E1339;
ViSession INST;
int ch_first = 100;
int ch_last = 102;
int loop;
/* Open a default Resource Manager */
errStatus = viOpenDefaultRM (&viRM);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpenDefaultRM() returned 0x%x\n",errStatus);
return errStatus;}
/* Open the External Instrument Session */
errStatus = viOpen (viRM, INSTR_ADDR2,VI_NULL,VI_NULL, &INST);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpen(%s) returned 0x%x\n",INSTR_ADDR2,errStatus);
return errStatus;}
/* Configure the External Instrument */
/*External Instrument configuration commands go here*/
/* Open the Relay Driver Module Instrument Session */
errStatus = viOpen (viRM, INSTR_ADDR1,VI_NULL,VI_NULL, &E1339);
if (VI_SUCCESS > errStatus){
printf("ERROR: viOpen(%s) returned 0x%x\n",INSTR_ADDR1,errStatus);
return errStatus;}
/* Reset the Relay Driver Module */
errStatus = viPrintf (E1339, "*RST;*CLS\n");
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
return errStatus;}
/* Enable the Agilent E1306A Trig Out Port */
errStatus = viPrintf (E1339, "OUTP ON\n");
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
/* logical addr */
/* logical address*/
/* status from VISA call */
/* Resource Mgr. session */
/* session for E1339A */
/*session for Ext Instr*/
/* first scan channel = 100 */
/* last scan channel = 102 */
Understanding the Relay Driver Module
53

Advertisement

Table of Contents
loading

This manual is also suitable for:

Z2309a

Table of Contents