Agilent Technologies E1563A Stereo Receiver User Manual


 
Register-Based Programming 143Appendix B
/* E1564A only for channels 3 and 4 -------------- */
err=ViIn16(digitizer,VI_A16_SPACE,0x14,&cvt_reg);
if (err<VI_SUCCESS) err_handler(digitizer,err);
printf(“channel 3 = 0x%4X\n”, cvt_reg);
last_reading = (double)cvt_reg*4/32768;
printf(“channel 3 = %lf Volts\n”, last_reading);
err=ViIn16(digitizer,VI_A16_SPACE,0x16,&cvt_reg);
if (err<VI_SUCCESS) err_handler(digitizer,err);
printf(“channel 4 = 0x%4X\n”, cvt_reg);
last_reading = (double)cvt_reg*4/32768;
printf(“channel 4 = %lf Volts\n”, last_reading);
/* 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 */
{