Configuration
Example
The following program segment demonstrates how to read the module
identification string and the configuration. The configuration integers are
bit manipulated using the C operator for bit shifting
result = result <<1
(a one bit shift to the left).
•
•
•
/** FUNCTION PROTOTYPES **/
void main (void);
void err_handler(ViSession vi, ViStatus x); /* VTL error routine */
void sys_err(ViSession resource); /* Checks for SCPI programming errors */
/** GLOBAL **/
ViStatus err;
ViSession defaultRM, cmd, dac;
•
•
•
void main (void)
{
int i,num_chan,result = {0},config [6]={0};
char buf[256] = { 0 };
/*** Check the module identification ***/
err=viPrintf(dac, “*IDN?\n”); /* request id from the module */
err=viScanf(dac, “%t”, &buf); /* enter string returned */
printf (“Module is identified as a %s\n”, buf); /* print the result */
/*** Get the module configuration ***/
err=viPrintf(dac, “DIAG:CONF?\n”); /* request module configuration */
err=viScanf(dac, “%,6d”, &config); /* returns six integers */
/* Decode the first integer */
result=config[0]; /* Expansion board */
if (result < 7)
{
printf (“Module is a 16 channel device\n”);
num_chan = 16;
}
else
{
printf (“Module is an 8 channel device\n”);
num_chan=8;
}
42 Programming Examples
Chapter 2
Summary of Contents for E1418A
Page 6: ...Notes 6 Contents HP E1418A 8 16 Channel D A Converter Module ...
Page 10: ...Notes 10 HP E1418A User s Manual ...
Page 12: ...12 HP E1418A User s Manual ...
Page 105: ...TRIGger 105 HP E1418A SCPI Command Reference Chapter 3 ...
Page 111: ...Notes HP E1418A Command Quick Reference 111 HP E1418A SCPI Command Reference Chapter 3 ...
Page 135: ...135 HP E1418A Register Based Programming Appendix B ...
Page 157: ...Notes 156 HP E1418A Error Messages Appendix C ...
Page 170: ...Notes Appendix D Voltage Current Output Adjustment 169 ...
Page 174: ...Figure E 1 8 Channel Disassembly 172 Configuration and Disassembly Appendix E ...
Page 175: ...Figure E 2 16 Channel Disassembly Appendix E Configuration and Disassembly 173 ...
Page 192: ...Notes 192 HP E1418A 8 16 Channel D A Converter Module Index ...