if(err < VI_SUCCESS)err_handler(rf_mux,err);
/* read the ID and Device Type registers */
err = viIn16(rf_mux,VI_A16_SPACE,0x00,&id_reg); if(err < VI_SUCCESS)err_handler(rf_mux,err);
err = viIn16(rf_mux,VI_A16_SPACE,0x02,&dt_reg); if(err < VI_SUCCESS)err_handler(rf_mux,err); printf("ID register = 0x%4X\nDevice Type register =
0x%4X\n",id_reg,dt_reg);
/* read the Status Register */
err = viIn16(rf_mux,VI_A16_SPACE,0x04,&stat_reg); if(err < VI_SUCCESS)err_handler(rf_mux,err);
printf("Status register = "0x%4X\n",stat_reg);
/* close relays on registers 20h & 28h for signal path */ /* from CH031 to COM05. 20840 decimal = 5000h and */ /* 38 decimal = 26h */
err = viOut16(rf_mux,VI_A16_SPACE,0x20,0x5000);
if(err < VI_SUCCESS)err_handler(rf_mux,err); err = viOut16(rf_mux,VI_A16_SPACE,0x28,0x26); if(err < VI_SUCCESS)err_handler(rf_mux,err);
/* read relay control registers and print their values */
err = viIn16(rf_mux,VI_A16_SPACE,0x20,®_20h); if(err < VI_SUCCESS)err_handler(rf_mux,err);
err = viIn16(rf_mux,VI_A16_SPACE,0x22,®_22h); if(err < VI_SUCCESS)err_handler(rf_mux,err);
err = viIn16(rf_mux,VI_A16_SPACE,0x24,®_24h); if(err < VI_SUCCESS)err_handler(rf_mux,err);
err = viIn16(rf_mux,VI_A16_SPACE,0x26,®_26h); if(err < VI_SUCCESS)err_handler(rf_mux,err);
err = viIn16(rf_mux,VI_A16_SPACE,0x28,®_28h); if(err < VI_SUCCESS)err_handler(rf_mux,err);
/* wait 5 seconds before resetting module */
wait (5);
/* reset the E1470A to open all closed channels */
/* writing a 0 to the relay control registers also opens channels */
err = viOut16(rf_mux,VI_A16_SPACE,0x04,1); if(err < VI_SUCCESS)err_handler(rf_mux,err);
50 | Appendix B |