Allow one retry after a communication error.

This commit is contained in:
Ron Sluiter
2001-10-02 22:44:11 +00:00
parent 622c126137
commit f712bcee23
2 changed files with 48 additions and 26 deletions
+24 -13
View File
@@ -3,9 +3,9 @@ FILENAME... drvIM483PL.c
USAGE... Motor record driver level support for Intelligent Motion
Systems, Inc. IM483(I/IE).
Version: $Revision: 1.1 $
Version: $Revision: 1.2 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2000-07-25 13:36:42 $
Last Modified: $Date: 2001-10-02 22:44:11 $
*/
/*
@@ -35,7 +35,8 @@ Last Modified: $Date: 2000-07-25 13:36:42 $
*
* Modification Log:
* -----------------
* .01 07/10/2000 rls copied from drvIM483SM.c
* .01 07/10/00 rls copied from drvIM483SM.c
* .02 10/02/01 rls allow one retry after a communication error.
*/
/*
@@ -243,10 +244,27 @@ STATIC int set_status(int card, int signal)
send_mess(card, "? ^", IM483PL_axis[signal]);
rtn_state = recv_mess(card, buff, 1);
if (rtn_state <= 0)
cntrl->status = COMM_ERR;
else
if (rtn_state > 0)
{
cntrl->status = NORMAL;
motor_info->status &= ~CNTRL_COMM_ERR;
}
else
{
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 = atoi(&buff[4]);
if (status != 0)
@@ -306,7 +324,6 @@ STATIC int set_status(int card, int signal)
* Skip to substring for this motor, convert to double
*/
send_mess(card, "? Z 0", IM483PL_axis[signal]);
recv_mess(card, buff, 1);
@@ -347,11 +364,6 @@ STATIC int set_status(int card, int signal)
nodeptr->postmsgptr = NULL;
}
if (cntrl->status == COMM_ERR)
motor_info->status |= CNTRL_COMM_ERR;
else
motor_info->status &= ~CNTRL_COMM_ERR;
return(rtn_state);
}
@@ -529,7 +541,6 @@ int IM483PLConfig(int card, /* card being configured */
}
/*****************************************************/
/* initialize all software and hardware */
/* This is called from the initialization routine in */
+24 -13
View File
@@ -3,9 +3,9 @@ FILENAME... drvIM483SM.c
USAGE... Motor record driver level support for Intelligent Motion
Systems, Inc. IM483(I/IE).
Version: $Revision: 1.1 $
Version: $Revision: 1.2 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2000-07-25 13:36:44 $
Last Modified: $Date: 2001-10-02 22:42:36 $
*/
/*
@@ -35,7 +35,8 @@ Last Modified: $Date: 2000-07-25 13:36:44 $
*
* Modification Log:
* -----------------
* .01 02/10/2000 rls copied from drvMM4000.c
* .01 02/10/00 rls copied from drvMM4000.c
* .02 10/02/01 rls allow one retry after a communication error.
*/
/*
@@ -244,10 +245,27 @@ STATIC int set_status(int card, int signal)
send_mess(card, "^", NULL);
rtn_state = recv_mess(card, buff, 1);
if (rtn_state <= 0)
cntrl->status = COMM_ERR;
else
if (rtn_state > 0)
{
cntrl->status = NORMAL;
motor_info->status &= ~CNTRL_COMM_ERR;
}
else
{
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 = atoi(&buff[4]);
if (status != 0)
@@ -307,7 +325,6 @@ STATIC int set_status(int card, int signal)
* Skip to substring for this motor, convert to double
*/
send_mess(card, "Z 0", NULL);
recv_mess(card, buff, 1);
@@ -348,11 +365,6 @@ STATIC int set_status(int card, int signal)
nodeptr->postmsgptr = NULL;
}
if (cntrl->status == COMM_ERR)
motor_info->status |= CNTRL_COMM_ERR;
else
motor_info->status &= ~CNTRL_COMM_ERR;
return(rtn_state);
}
@@ -537,7 +549,6 @@ int IM483SMConfig(int card, /* card being configured */
}
/*****************************************************/
/* initialize all software and hardware */
/* This is called from the initialization routine in */