Example: Module Identification (Turbo C) - Agilent Technologies E1463A User's Manual And Scpi Programming Manual

32-channel, 5 amp, form c switch scpi programming guide
Hide thumbs Also See for E1463A:
Table of Contents

Advertisement

Example: Module
Identification
(TURBO C)
Chapter 2
#include stdio.h
#include chpib.h
#define ISC 7L
#define FORMC 70915L
#define TASK1 "*RST;*CLS;*IDN?" /*Reset, clear, and query id*/
#define TASK2 "SYST:CDES? 1"
#define TASK3 "SYST:CTYP? 1"
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;
}
/*Include file for GPIB*/
/*Form C default address*/
/*Command for card description*/
/*Command for card type*/
Using the Form C Switch 33

Advertisement

Table of Contents
loading

Table of Contents