2635A
Users Manual
4-66
/*
* This function checks the Hydra prompt after sending a command to Hydra,
* to see if an error occurred.
*
* Possible responses are:
* "=>(CR)(LF)" (Command successful)
* "?>(CR)(LF)" (Command syntax error)
* "!>(CR)(LF)" (Command execution error)
*/
static int checkResponse()
{
char response[129];
/* Gets string from Hydra -- asigets_timed
gets characters from the receive buffer,
and strips the (CR)(LF) characters from
the end before placing them in the
"response" buffer */
asigets_timed(COM2,response,128,-2,TICKS_PER_SECOND*2);
/* check to see if the command worked correctly */
if(strcmp(response,"=>") == 0)
return 0; /* command executed without error */
if(strcmp(response,"?>") == 0)
fprintf(stderr,"Command Syntax Error!\n");
else
{
if(strcmp(response,"!>") == 0)
fprintf(stderr,"Command Execution Error!\n");
}
fprintf(stderr,"\nProgram execution halted due to communications errors\n");
fclose(testdata);
exit(1);
}
op53_5f.eps
Figure 4-7. Sample Program (QuickC)(5 of 5)
Содержание 2635A
Страница 8: ...2635A Users Manual vi...
Страница 26: ...2635A Users Manual xxiv...
Страница 29: ...Preparation for Use Introduction 1 1 3...
Страница 50: ...2635A Users Manual 1 24...
Страница 53: ...Front Panel Operations Summary of Front Panel Operations 2 2 3...
Страница 88: ...2635A Users Manual 2 38...
Страница 180: ...2635A Users Manual 5 10...
Страница 212: ......
Страница 234: ...2635A Users Manual B 4...
Страница 250: ...2635A Users Manual D 8...
Страница 251: ...E 1 Appendix E 8 Bit Binary Coded Decimal Table...
Страница 264: ...Hydra Memory Card Record DATA FILES SET UP FILES DATxx Application Note SETxx Application Note...
Страница 268: ...2635A Users Manual 4...