
Appendix B
Verification Tests - C Programs
Functional
Verification
Test
These programs are designed to do the Functional Verification Tests found
in Chapter 4 - Verification Tests.
Example: Self Test
This example performs a DAC self test (*TST? command) to ensure that the
DAC is communicating with the mainframe, external controller, and/or
external terminal.
#include <stdio.h>
#include <sicl.h>
#define ADDR "hpib7,9,9"
/* Address of Device */
void main ()
{
INST id;
/* Define id as an instrument */
char a[256] = {0};
/* Result variable */
id = iopen (ADDR);
/* Open instrument session */
itimeout (id, 10000);
/* Set 10 sec timeout */
ipromptf (id, "*TST?\n", "%t", a);
/* Self test command */
printf ("\n %s", a);
/* Print result */
getchar ();
/* Pause */
iclose (id);
/* Close instrument session */
}
Appendix B
Verification Tests - C Programs 61