Agilent E1412A Multimeter Module Setup
23
#include <stdio.h>
#include <visa.h>
/*** FUNCTION PROTOTYPE ***/
void err_handler (ViSession vi, ViStatus x);
void main(void)
{
char buf[512] = {0};
#if defined(_BORLANDC_) && !defined(_WIN32_)
_InitEasyWin();
#endif
ViStatus err;
ViSession defaultRM;
ViSession dmm;
/* Open resource manager and multimeter sessions. */
viOpenDefaultRM (&defaultRM);
viOpen(defaultRM, "GPIB-VXI0::9::24", VI_NULL, VI_NULL, &dmm);
/* Set the timeout value to 10 seconds. */
viSetAttribute (dmm, VI_ATTR_TMO_VALUE, 10000);
/* Reset the module. */
err = viPrintf (dmm, "*RST/n");
if (err<VI_SUCCESS) err_handler (dmm, err);
/* Query the module identification. */
err = viPrintf(dmm, "*IDN?/n");
if (err<VI_SUCCESS) err_handler (dmm, err);
err = viScanf(dmm, "%t", buf);
if (err<VI_SUCCESS) err_handler (dmm, err);
printf ("Module ID = %s/n/n", buf);
/* Perform a module self-test. */
err = viPrintf (dmm, "*TST?/n");
if(err<VI_SUCCESS) err_handler (dmm, err);
err = viScanf (dmm, "%t", buf);
if (err<VI_SUCCESS) err_handler (dmm, err);
printf ("Self-test response = %s/n/n", buf);
/* Check for system errors. */
err = viPrintf (dmm, "SYST:ERR?/n");
if (err<VI_SUCCESS) err_handler (dmm, err);
err = viScanf (dmm, "%t", buf);
if (err<VI_SUCCESS) err_handler (dmm, err);
printf ("System error response = %s/n/n", buf);
}
/* end of main */
/*** Error handling function ***/
void err_handler (ViSession dmm, ViStatus err)
{
char buf[1024] = {0};
viStatusDesc (dmm, err, buf);
printf ("ERROR = %s/n", buf);
return;
}
Summary of Contents for Agilent E1412A
Page 2: ......
Page 10: ...8 Contents Notes...
Page 14: ...12 Notes...
Page 15: ...13 Notes...
Page 16: ...14 Notes...
Page 26: ...24 Agilent E1412A Multimeter Module Setup Chapter 1 Notes...
Page 194: ...192 Agilent E1412A Multimeter Error Messages Appendix B Notes...
Page 201: ...Index 199 Index Agilent E1412A User s Manual and SCPI Programming Guide...