VXI VT1422A User Manual

Page 33

Advertising
background image

Getting Started 33

Chapter 1

return;
}

rst_inst(); /* Resets the instrument and sends a device clear */

reads_instrument_id(); /* Reads instrument software revision */

/* close the device session */
hpe1422_close(addr);
}

/****************************************************************************/
void rst_inst(void)
/* Function to set the interface timeout period, resets the instrument, */
/* waits for completion of reset and sends a device clear to enable */
/* the instrument to receive a new command */
{
ViInt32 result;

/* set timeout to allow completion of reset */
errStatus = hpe1422_timeOut(addr, 5000);
check(addr, errStatus);

/* reset the instrument */
errStatus = hpe1422_reset(addr);
check(addr, errStatus);

/* wait for completion of *RST */
errStatus = hpe1422_cmdInt32_Q(addr,"*OPC?",&result);
check(addr, errStatus);

/* send a device clear to enable new commands to be sent to the instrument */
errStatus = hpe1422_dcl(addr);
check(addr, errStatus);

/* enables automatic error checking after each driver call */
errStatus = hpe1422_errorQueryDetect( addr, VI_TRUE);

}

/****************************************************************************/
void reads_instrument_id(void)
/* Function uses a hpe1422__revision_query to read the software revision */
/* string. */
{
ViChar driver_rev[256];
ViChar instr_rev[256];

/* Query the instrument for its firmware revision */
errStatus = hpe1422_revision_query(addr, driver_rev, instr_rev);

/* Print the results */
printf("The instrument driver's revision is %s\n", driver_rev);
printf("The instrument's firmware revision is %s\n", instr_rev);
}

/****************************************************************************/
/****************************************************************************/
/* error checking routine */
void check (ViSession addr, ViStatus errStatus)
{
ViInt32 err_code;
ViChar err_message[256];

Advertising
This manual is related to the following products: