HP VXI 75000 C Series User's And Scpi Programming Manual page 391

Algorithmic closed loop controller
Table of Contents

Advertisement

if (!*command) {
}
result[0] = 0;
cscpi_exe(e1415, command, strlen(command), result, sizeof(result));
INST_QUERY(e1415, "syst:err?", "%d,%s", &error, string);
while ( error ) {
}
if (result[0]) {
}
}
}
#endif
/* Print usage information */
void usage(char *prog_name)
{
(void) fprintf(stderr, "usage: %s algorithm_file...\n", prog_name);
}
/* Get an algorithm from a filename */
static char *get_algorithm(char *file_name)
{
FILE
int32
int
char
f = fopen(file_name, "r");
if (! f) {
(void) fprintf(stderr, "Error: can't open algorithm file '%s'\n",
exit(1);
}
a_size = 0;
while (getc(f) != EOF) {
a_size++;
}
rewind(f);
algorithm = malloc(a_size + 1);
a_size = 0;
while ((c = getc(f)) != EOF) {
algorithm[a_size] = c;
a_size++;
}
algorithm[a_size] = 0;
(void) fclose(f);
return algorithm;
}
Appendix G
break;
(void) printf("syst:err %d,'%s'\n", error, string);
INST_QUERY(e1415,"syst:err?", "%d,%s", &error, string);
(void) printf("result: %s\n", result);
*f;
/* Algorithm file pointer */
a_size;
/* Algorithm size */
c;
/* Character read from input */
*algorithm;
/* Points to algorithm string */
file_name);
/* Count length of algorithm */
/* Use as array index */
/* Read the algorithm */
/* Null terminate */
/* Return algorithm string */
/* Storage for algorithm */
Example Program Listings
391

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vxi e1415a

Table of Contents