From cbb8892f18d06e5a32198ec7e1c196f9fc678755 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Tue, 2 Oct 2001 22:22:07 +0000 Subject: [PATCH] Allow one retry after a communication error. --- motorApp/NewportSrc/drvPM500.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/motorApp/NewportSrc/drvPM500.c b/motorApp/NewportSrc/drvPM500.c index 17735891..e9ac5bbe 100644 --- a/motorApp/NewportSrc/drvPM500.c +++ b/motorApp/NewportSrc/drvPM500.c @@ -31,8 +31,9 @@ * * Modification Log: * ----------------- - * .01 11-19-98 mlr Initial development, based on drvMM4000.c - * .02 06-02-00 rls integrated into standard motor record + * .01 11-19-98 mlr Initial development, based on drvMM4000.c + * .02 06-02-00 rls integrated into standard motor record + * .03 10/02/01 rls allow one retry after a communication error. */ @@ -248,13 +249,24 @@ STATIC int set_status(int card, int signal) send_mess(card, buff, NULL); status = recv_mess(card, response, 1); if (status > 0) + { cntrl->status = NORMAL; + motor_info->status &= ~CNTRL_COMM_ERR; + } else { - cntrl->status = COMM_ERR; - motor_info->status |= RA_PROBLEM; /* This terminates the transaction. */ - rtn_state = 1; - goto exit; + if (cntrl->status == NORMAL) + { + cntrl->status = RETRY; + return(0); + } + else + { + cntrl->status = COMM_ERR; + motor_info->status |= CNTRL_COMM_ERR; + motor_info->status |= RA_PROBLEM; + return(1); + } } status_char = response[1]; @@ -346,12 +358,6 @@ STATIC int set_status(int card, int signal) nodeptr->postmsgptr = NULL; } -exit: - if (cntrl->status == COMM_ERR) - motor_info->status |= CNTRL_COMM_ERR; - else - motor_info->status &= ~CNTRL_COMM_ERR; - return(rtn_state); }