Return The Module To Use; Example Program - HP E1418A User Manual

8/16-channel d/a converter module
Hide thumbs Also See for E1418A:
Table of Contents

Advertisement

Return the
Module to Use

Example Program

/** FUNCTION PROTOTYPES **/
void main (void);
void err_handler(ViSession vi, ViStatus x);
void sys_err(ViSession resource);
void pause();
int config_check ();
float get_voltage ();
float get_resistance ();
void main (void)
{
char cal_point [5],int_ext [4];
int num_chan,result,compare,i,condition [4];
float meas_volt,meas_res;
/***
VOLTAGE OUTPUT ADJUSTMENT
for (i=1;i<num_chan+1;i++)
result = 1;
166
Voltage/Current Output Adjustment
resets until the store is complete. You can use the
on page 56, if needed.
If you have changed the position of the Cal Store Enable Jumper (as
described on page 159) and you wish to prevent writing calibration
constants to non-volatile memory, set the jumper to the SECURE position.
The following program, written in ANSI C illustrates a full calibration of all
channels for both voltage and resistance. The internal calibration resistor is
used. The SCPI drivers disk contains a calibration example file. This
example uses function calls to the HP VISA Transition Library for I/O
operations. Page 39 provides more details about this library.
{
result = 0;
while (result < 1)
{
err=viPrintf(dac, "CAL%d:CONF:VOLT?\n",i); /* Configure for calibration */
if(err < VI_SUCCESS) err_handler(dac, err);
err=viScanf(dac, "%d", &result);
if(err < VI_SUCCESS) err_handler(dac, err);
}
/* VTL error routine */
/* Checks for SCPI programming errors */
/* Waits for a keystroke to continue program execution */
/* Checks and reports the module configuration */
/* returns the number of channels in module */
/* Obtains the measured voltage */
/* Obtains the measured resistance */
***/
/* Enter integer returned */
/* returns a 1 when ready to calibrate */
query as described
*OPC?
Appendix D

Advertisement

Table of Contents
loading

Table of Contents