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

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

Advertisement

56 Understanding the Relay Driver Module
/* 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;}
/* 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 Scan Complete Bit to Set Bit 7 in Status Byte Register */
errStatus = viPrintf (E1339, "STAT:OPER:ENAB 256\n");
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
return errStatus;}
/* Set External Triggering Mode*/
errStatus = viPrintf (E1339, "TRIG:SOUR EXT\n");
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
return errStatus;}
/* Set up Scan List*/
errStatus = viPrintf (E1339, "SCAN (@%d:%d)\n",ch_first,ch_last);
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
return errStatus;}
/* Enable Scan */
errStatus = viPrintf (E1339, "INIT\n");
if (VI_SUCCESS > errStatus){
printf("ERROR: viPrintf() returned 0x%x\n",errStatus);
return errStatus;}
/* Wait for Scan Complete*/
/*Program lines for computer to do other operations*/
/* Go to Interrupt Routine*/
/*Program goes to this line after scan cycle*/
/* is complete, thus generating an interrupt.*/
/* 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;}
}

Advertisement

Table of Contents
loading

This manual is also suitable for:

Z2309a

Table of Contents