HP E1563A User Manual page 133

Table of Contents

Advertisement

/* read all 7 readings from all channels */
/* comment the channel 3/4 lines out if running the 2-channel E1563A */
for (i=0; i<7; ++i)
{
err=ViIn16(digitizer,VI_A16_SPACE,0x08,&cache_reg);
if (err<VI_SUCCESS) err_handler(digitizer,err);
reading = (double)cache_reg*4/32768;
printf("channel 1 = %lf Volts\n", reading);
err=ViIn16(digitizer,VI_A16_SPACE,0x0A,&cache_reg);
if (err<VI_SUCCESS) err_handler(digitizer,err);
reading = (double)cache_reg*4/32768;
printf("channel 2 = %lf Volts\n", reading);
/* E1564A only for channels 3 and 4 -- comment out for E1563A */
err=ViIn16(digitizer,VI_A16_SPACE,0x08,&cache_reg);
if (err<VI_SUCCESS) err_handler(digitizer,err);
reading = (double)cache_reg*4/32768;
printf("channel 3 = %lf Volts\n", reading);
err=ViIn16(digitizer,VI_A16_SPACE,0x0A,&cache_reg);
if (err<VI_SUCCESS) err_handler(digitizer,err);
reading = (double)cache_reg*4/32768;
printf("channel 4 = %lf Volts\n", reading);
}
/* end of if statement */
/* reset the digitizer */
reset(digitizer,err);
printf("\nHP E1563A/E1564A is reset");
/***** Close session *****/
ViClose(digitizer);
ViClose(defaultRM);
}
Reset Function
/************************************************************/
void reset(ViSession digitizer, ViStatus err)
/* reset the digitizer (write a 1 to status bit 0) delay 1 second for reset */
/* then set bit back to 0 to allow module to operate */
{
/* write a "1" to the reset bit then set the bit back to "0" */
err=ViOut16(digitizer,VI_A16_SPACE,0x04,1);
if (err<VI_SUCCESS) err_handler(digitizer,err);
wait(1);
err=ViOut16(digitizer,VI_A16_SPACE,0x04,0);
if (err<VI_SUCCESS) err_handler(digitizer,err);
return;
}
Appendix B
HP E1563A and E1564A Register-Based Programming 133
/* set reset bit to "1" */
/* set reset bit to "0" */

Advertisement

Table of Contents
loading

This manual is also suitable for:

E1564a

Table of Contents