Using the Form C Switch 33
Chapter 2
Example: Module
Identification
(TURBO C)
#include stdio.h
#include chpib.h
/*Include file for GPIB*/
#define ISC 7L
#define FORMC 70915L
/*Form C default address*/
#define TASK1 "*RST;*CLS;*IDN?" /*Reset, clear, and query id*/
#define TASK2 "SYST:CDES? 1" /*Command for card description*/
#define TASK3 "SYST:CTYP? 1"
/*Command for card type*/
main( )
{
char into1[51], into2[51], into3[51];
int length = 50; /*Output and enter commands to Form C*/
error_handler (IOTIMEOUT (7L,5.0), "TIMEOUT");
error_handler (IOOUTPUTS (FORMC, TASK1, 15), "OUTPUT command");
error_handler (IOENTERS (FORMC, into1, &length), "ENTER command");
error_handler (IOOUTPUTS (FORMC, TASK2, 12), "OUTPUT command");
error_handler (IOENTERS (FORMC, into2, &length), "ENTER command");
error_handler (IOOUTPUTS (FORMC, TASK3, 12), "OUTPUT command");
error_handler (IOENTERS (FORMC, into3, &length), "ENTER command");
printf("IDENTIFICATION: %s",into1);
printf("CARD DESCRIPTION: %s",into2);
printf("CARD TYPE: %s",into3);
return;
}
int error_handler (int error, char *routine)
{
char ch;
if (error != NOERR)
{
printf ("\n Error %d %s \n", error, errstr(error));
printf (" in call to GPIB function %s \n\n", routine);
printf ("Press 'Enter' to exit: ");
scanf ("%c", &ch);
exit(0);
}
return 0;
}
Содержание E1463A
Страница 2: ......
Страница 6: ...6 Notes ...
Страница 10: ...10 Notes ...
Страница 78: ...78 Form C Switch Specifications Appendix A Notes ...
Страница 98: ...98 Index Notes ...