Support for 32axes/controller.

This commit is contained in:
Ron Sluiter
2004-09-20 21:14:14 +00:00
parent 69c924a59a
commit e6ae2c4eb6
6 changed files with 57 additions and 52 deletions
+10 -12
View File
@@ -3,9 +3,9 @@ FILENAME... drvIM483SM.cc
USAGE... Motor record driver level support for Intelligent Motion
Systems, Inc. IM483(I/IE).
Version: $Revision: 1.11 $
Modified By: $Author: rivers $
Last Modified: $Date: 2004-08-17 21:28:30 $
Version: $Revision: 1.12 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2004-09-20 21:05:39 $
*/
/*****************************************************************
@@ -34,6 +34,7 @@ of this distribution.
* .04 03/07/03 rls R3.14 conversion.
* .05 02/03/04 rls Eliminate erroneous "Motor motion timeout ERROR".
* .06 07/01/04 rls Converted from MPF to asyn.
* .07 09/20/04 rls support for 32axes/controller.
*/
/*
@@ -88,9 +89,9 @@ int IM483SM_num_cards = 0;
/*----------------functions-----------------*/
static int recv_mess(int, char *, int);
static RTN_STATUS send_mess(int card, char const *com, char c);
static int set_status(int card, int signal);
static long report(int level);
static RTN_STATUS send_mess(int, char const *, char *);
static int set_status(int, int);
static long report(int);
static long init();
static int motor_init();
static void query_done(int, int, struct mess_node *);
@@ -373,7 +374,7 @@ exit:
/* send a message to the IM483SM board */
/* send_mess() */
/*****************************************************/
static RTN_STATUS send_mess(int card, char const *com, char inchar)
static RTN_STATUS send_mess(int card, char const *com, char *name)
{
char local_buff[MAX_MSG_SIZE];
struct IM483controller *cntrl;
@@ -395,9 +396,9 @@ static RTN_STATUS send_mess(int card, char const *com, char inchar)
return(ERROR);
}
if (inchar != (char) NULL)
if (name != NULL)
{
errlogPrintf("drvIM483SM.c:send_mess() - invalid argument = %c\n", inchar);
errlogPrintf("drvIM483SM.c:send_mess() - invalid argument = %s\n", name);
return(ERROR);
}
@@ -405,9 +406,6 @@ static RTN_STATUS send_mess(int card, char const *com, char inchar)
strcpy(local_buff, com);
strcat(local_buff, "\r");
if (inchar != (char) NULL)
local_buff[0] = inchar; /* put in axis */
Debug(2, "send_mess(): message = %s\n", local_buff);
cntrl = (struct IM483controller *) motor_state[card]->DevicePrivate;
+23 -17
View File
@@ -3,9 +3,9 @@ FILENAME... drvMDrive.cc
USAGE... Motor record driver level support for Intelligent Motion
Systems, Inc. MDrive series; M17, M23, M34.
Version: $Revision: 1.12 $
Modified By: $Author: rivers $
Last Modified: $Date: 2004-08-17 21:28:30 $
Version: $Revision: 1.13 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2004-09-20 21:10:34 $
*/
/*
@@ -41,6 +41,8 @@ Last Modified: $Date: 2004-08-17 21:28:30 $
* Kevin Peterson's eat_garbage() function. Added support
* for encoder detection via "ident".
* .04 07/01/04 rls Converted from MPF to asyn.
* .05 09/20/04 rls - support for 32axes/controller.
* - remove '?' command string padding.
*/
/*
@@ -79,7 +81,7 @@ DESIGN LIMITATIONS...
/* --- Local data. --- */
int MDrive_num_cards = 0;
static char MDrive_axis[8] = {'1', '2', '3', '4', '5', '6', '7', '8'};
static char *MDrive_axis[] = {"1", "2", "3", "4", "5", "6", "7", "8"};
/* Local data required for every driver; see "motordrvComCode.h" */
#include "motordrvComCode.h"
@@ -87,9 +89,9 @@ static char MDrive_axis[8] = {'1', '2', '3', '4', '5', '6', '7', '8'};
/*----------------functions-----------------*/
static int eat_garbage(int, char *, int);
static int recv_mess(int, char *, int);
static RTN_STATUS send_mess(int card, char const *com, char c);
static int set_status(int card, int signal);
static long report(int level);
static RTN_STATUS send_mess(int, char const *, char *);
static int set_status(int, int);
static long report(int);
static long init();
static int motor_init();
static void query_done(int, int, struct mess_node *);
@@ -265,7 +267,7 @@ static int set_status(int card, int signal)
nodeptr = motor_info->motor_motion;
status.All = motor_info->status.All;
send_mess(card, "?PR MV", MDrive_axis[signal]);
send_mess(card, "PR MV", MDrive_axis[signal]);
eat_garbage(card, buff, 1);
rtn_state = recv_mess(card, buff, 1);
if (rtn_state > 0)
@@ -301,7 +303,7 @@ static int set_status(int card, int signal)
* Skip to substring for this motor, convert to double
*/
send_mess(card, "?PR P", MDrive_axis[signal]);
send_mess(card, "PR P", MDrive_axis[signal]);
eat_garbage(card, buff, 1);
recv_mess(card, buff, 1);
@@ -324,7 +326,7 @@ static int set_status(int card, int signal)
plusdir = (status.Bits.RA_DIRECTION) ? true : false;
send_mess(card, "?PR IN", MDrive_axis[signal]);
send_mess(card, "PR IN", MDrive_axis[signal]);
eat_garbage(card, buff, 1);
recv_mess(card, buff, 1);
inputs.All = atoi(buff);
@@ -362,7 +364,7 @@ static int set_status(int card, int signal)
motor_info->encoder_position = 0;
else
{
send_mess(card, "?PR C2", MDrive_axis[signal]);
send_mess(card, "PR C2", MDrive_axis[signal]);
eat_garbage(card, buff, 1);
recv_mess(card, buff, 1);
motorData = atof(buff);
@@ -401,7 +403,7 @@ exit:
/* send a message to the MDrive board */
/* send_mess() */
/*****************************************************/
static RTN_STATUS send_mess(int card, char const *com, char inchar)
static RTN_STATUS send_mess(int card, char const *com, char *name)
{
char local_buff[MAX_MSG_SIZE];
struct IM483controller *cntrl;
@@ -424,11 +426,15 @@ static RTN_STATUS send_mess(int card, char const *com, char inchar)
}
/* Make a local copy of the string and add the command line terminator. */
strcpy(local_buff, com);
strcat(local_buff, "\n");
if (name != NULL)
{
strcpy(local_buff, name); /* put in axis */
strcat(local_buff, com);
}
else
strcpy(local_buff, com);
if (inchar != (char) NULL)
local_buff[0] = inchar; /* put in axis */
strcat(local_buff, "\n");
Debug(2, "send_mess(): message = %s\n", local_buff);
@@ -625,7 +631,7 @@ static int motor_init()
/* Try 3 times to connect to controller. */
do
{
send_mess(card_index, "?PR VR", MDrive_axis[total_axis]);
send_mess(card_index, "PR VR", MDrive_axis[total_axis]);
eat_garbage(card_index, buff, 1);
status = recv_mess(card_index, buff, 1);
retry++;
+4 -4
View File
@@ -2,9 +2,9 @@
FILENAME... drvMXmotor.cc
USAGE... Motor record driver level support for MX device driver.
Version: $Revision: 1.5 $
Version: $Revision: 1.6 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2003-10-28 16:32:11 $
Last Modified: $Date: 2004-09-20 21:10:56 $
*/
/*
@@ -60,7 +60,7 @@ static long report(int level);
static long init();
static void query_done(int, int, struct mess_node *);
static int set_status(int card, int signal);
static RTN_STATUS send_mess(int card, char const *com, char c);
static RTN_STATUS send_mess(int, char const *, char *);
static int recv_mess(int, char *, int);
static int motor_init();
@@ -310,7 +310,7 @@ static int set_status(int card, int signal)
return(rtn_state);
}
static RTN_STATUS send_mess(int card, char const *com, char inchar)
static RTN_STATUS send_mess(int card, char const *com, char *name)
{
struct controller *brdptr;
struct MXcontroller *cntrl;
+5 -3
View File
@@ -27,6 +27,7 @@
* .09 02/03/04 rls Eliminate erroneous "Motor motion timeout ERROR".
* .10 04/20/04 mlr Convert from MPF to ASYN
* .11 07/16/04 rls removed unused <driver>Setup() argument.
* .12 09/20/04 rls support for 32axes/controller.
*/
@@ -85,7 +86,7 @@ int PM304_num_cards = 0;
/*----------------functions-----------------*/
STATIC int recv_mess(int card, char *buff, int len);
STATIC RTN_STATUS send_mess(int card, const char *com, char c);
STATIC RTN_STATUS send_mess(int, const char *, char *);
STATIC int send_recv_mess(int card, const char *out, char *in);
STATIC void start_status(int card);
STATIC int set_status(int card, int signal);
@@ -116,7 +117,8 @@ struct driver_table PM304_access =
set_status,
query_done,
start_status,
&initialized
&initialized,
NULL
};
struct
@@ -340,7 +342,7 @@ STATIC int set_status(int card, int signal)
/* ring buffer */
/* send_mess() */
/*****************************************************/
STATIC RTN_STATUS send_mess(int card, const char *com, char c)
STATIC RTN_STATUS send_mess(int card, const char *com, char *name)
{
char *p, *tok_save;
char buff[BUFF_SIZE];
+8 -6
View File
@@ -12,6 +12,7 @@
* .02 02-12-2004 rls Copied from drvMicos.c. Upgraded from R3.14.x
* .03 02-17-2004 rls Removed Debug calls to tickGet().
* .04 07-12-2004 rls Converted from MPF to asyn.
* .05 09-20-2004 rls support for 32axes/controller.
*/
@@ -64,10 +65,10 @@ volatile int Micos_num_axis = 0;
/*----------------functions-----------------*/
static int recv_mess(int, char *, int);
static RTN_STATUS send_mess(int card, const char *com, char c);
static void start_status(int card);
static int set_status(int card, int signal);
static long report(int level);
static RTN_STATUS send_mess(int, const char *, char *);
static void start_status(int);
static int set_status(int, int);
static long report(int);
static long init();
static int motor_init();
static void query_done(int, int, struct mess_node *);
@@ -94,7 +95,8 @@ struct driver_table Micos_access =
set_status,
query_done,
start_status,
&initialized
&initialized,
NULL
};
struct
@@ -290,7 +292,7 @@ static int set_status(int card, int signal)
/* send a message to the Micos board */
/* send_mess() */
/*****************************************************/
static RTN_STATUS send_mess(int card, const char *com, char c)
static RTN_STATUS send_mess(int card, const char *com, char *name)
{
char buff[BUFF_SIZE];
struct MicosController *cntrl;
+7 -10
View File
@@ -3,9 +3,9 @@ FILENAME... drvMVP2001.cc
USAGE... Motor record driver level support for MicroMo
MVP 2001 B02 (Linear, RS-485).
Version: $Revision: 1.4 $
Modified By: $Author: rivers $
Last Modified: $Date: 2004-08-17 21:29:31 $
Version: $Revision: 1.5 $
Modified By: $Author: sluiter $
Last Modified: $Date: 2004-09-20 21:14:14 $
*/
/*
@@ -145,9 +145,9 @@ int MVP2001_num_cards = 0;
/*----------------functions-----------------*/
static int recv_mess(int, char *, int);
static RTN_STATUS send_mess(int card, char const *com, char c);
static int set_status(int card, int signal);
static long report(int level);
static RTN_STATUS send_mess(int, char const *, char *);
static int set_status(int, int);
static long report(int);
static long init();
static int motor_init();
static void query_done(int, int, struct mess_node *);
@@ -439,7 +439,7 @@ exit:
/* send a message to the MVP2001 board */
/* send_mess() */
/*****************************************************/
static RTN_STATUS send_mess(int card, char const *com, char inchar)
static RTN_STATUS send_mess(int card, char const *com, char *name)
{
char local_buff[MAX_MSG_SIZE];
struct MVPcontroller *cntrl;
@@ -465,9 +465,6 @@ static RTN_STATUS send_mess(int card, char const *com, char inchar)
strcpy(local_buff, com);
strcat(local_buff, "\r");
if (inchar != (char) NULL)
local_buff[0] = inchar; /* put in axis */
Debug(2, "send_mess(): message = %s\n", local_buff);
cntrl = (struct MVPcontroller *) motor_state[card]->DevicePrivate;