Agilent Technologies E1476A User Manual page 114

64-channel, 3-wire multiplexer module
Table of Contents

Advertisement

/* set all bits to 0 to open last closed channel */
iwpoke ((unsigned short *)(base_addr + 0x22), 0);
/* scan channels 32-47 in bank A (register offset 0x24) */
for (k=0; k<=15; k++)
{
iwpoke ((unsigned short *)(base_addr + 0x24), ldexp(1,k));
/* take measurement here after each iteration of the loop */
}
/* set all bits to 0 to open last closed channel */
iwpoke ((unsigned short *)(base_addr + 0x24), 0);
/* scan channels 48-63 in bank A (register offset 0x26) */
for (k=0; k<=15; k++)
{
iwpoke ((unsigned short *)(base_addr + 0x26), ldexp(1,k));
/* take measurement here after each iteration of the loop */
}
/* set all bits to 0 to open last closed channel */
iwpoke ((unsigned short *)(base_addr + 0x26), 0);
/* close SICL session */
iclose(e1476a);
} /* end of main */
Reset Function
/************************************************************/
void reset_mux(char *base_addr)
/* reset the mux to open all relays (write a 1 to status bit 0)*/
/* delay 100 ms for reset then set bit to 0 to allow closing*/
/* switches
{
/* this function resets the multiplexer */
iwpoke((unsigned short *)(base_addr + 0x04), 1);
delay (100);
iwpoke((unsigned short *)(base_addr + 0x04), 0); }}
Program Output
Appendix B
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
*/
/* must wait at least 100 usec before writing a "0" */
Printout from example program:
ID register = 0xFFFF
Device Type register = 0x 218
Status register = 0xFFBE
Channels 00-15 register = 0xFFFF
Channels 16-31 register = 0x 0
Channels 32-47 register = 0x 0
Channels 48-63 register = 0x 0
Channels 90-94 (tree) register = 0xFF01
Register-Based Programming 113

Advertisement

Table of Contents
loading

Table of Contents