diff --git a/motorApp/ImsSrc/drvIM483.h b/motorApp/ImsSrc/drvIM483.h index ceafa737..ab30118c 100644 --- a/motorApp/ImsSrc/drvIM483.h +++ b/motorApp/ImsSrc/drvIM483.h @@ -3,9 +3,9 @@ FILENAME... drvIM483.h USAGE... This file contains driver "include" information that is specific to Intelligent Motion Systems, Inc. IM483(I/IE). -Version: $Revision: 1.3 $ +Version: $Revision: 1.4 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2003-05-23 19:31:43 $ +Last Modified: $Date: 2003-05-27 21:57:54 $ */ /* @@ -44,6 +44,7 @@ Last Modified: $Date: 2003-05-23 19:31:43 $ #define INCdrvIM483h 1 #include "motordrvCom.h" +#include "serialIO.h" #define GPIB_TIMEOUT 2000 /* Command timeout in msec */ #define SERIAL_TIMEOUT 2000 /* Command timeout in msec */ @@ -53,7 +54,7 @@ Last Modified: $Date: 2003-05-23 19:31:43 $ struct IM483controller { int port_type; /* GPIB_PORT or RS232_PORT */ - struct serialInfo *serialInfo; /* For RS-232 */ + serialIO *serialInfo; /* For RS-232 */ int gpib_link; int gpib_address; struct gpibInfo *gpibInfo; /* For GPIB */ diff --git a/motorApp/ImsSrc/drvIM483PL.cc b/motorApp/ImsSrc/drvIM483PL.cc index e7578905..fd57a8a3 100644 --- a/motorApp/ImsSrc/drvIM483PL.cc +++ b/motorApp/ImsSrc/drvIM483PL.cc @@ -3,9 +3,9 @@ FILENAME... drvIM483PL.cc USAGE... Motor record driver level support for Intelligent Motion Systems, Inc. IM483(I/IE). -Version: $Revision: 1.2 $ +Version: $Revision: 1.3 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2003-05-19 17:09:07 $ +Last Modified: $Date: 2003-05-27 21:58:23 $ */ /***************************************************************** @@ -436,7 +436,7 @@ STATIC RTN_STATUS send_mess(int card, char const *com, char inchar) Debug(2, "send_mess(): message = %s\n", local_buff); cntrl = (struct IM483controller *) motor_state[card]->DevicePrivate; - serialIOSend(cntrl->serialInfo, local_buff, strlen(local_buff), SERIAL_TIMEOUT); + cntrl->serialInfo->serialIOSend(local_buff, strlen(local_buff), SERIAL_TIMEOUT); return(OK); } @@ -463,7 +463,7 @@ STATIC int recv_mess(int card, char *com, int flag) else timeout = SERIAL_TIMEOUT; - len = serialIORecv(cntrl->serialInfo, com, BUFF_SIZE, (char *) "\n", timeout); + len = cntrl->serialInfo->serialIORecv(com, BUFF_SIZE, (char *) "\n", timeout); if (len == 0) com[0] = '\0'; @@ -553,7 +553,7 @@ STATIC int motor_init() char buff[BUFF_SIZE]; int total_axis = 0; int status; - bool errind; + bool success_rtn; initialized = true; /* Indicate that driver is initialized. */ @@ -573,13 +573,11 @@ STATIC int motor_init() cntrl = (struct IM483controller *) brdptr->DevicePrivate; /* Initialize communications channel */ - errind = false; - cntrl->serialInfo = serialIOInit(cntrl->serial_card, - cntrl->serial_task); - if (cntrl->serialInfo == NULL) - errind = true; + success_rtn = false; + cntrl->serialInfo = new serialIO(cntrl->serial_card, + cntrl->serial_task, &success_rtn); - if (errind == false) + if (success_rtn == true) { /* Send a message to the board, see if it exists */ /* flush any junk at input port - should not be any data available */ @@ -597,7 +595,7 @@ STATIC int motor_init() brdptr->total_axis = total_axis; } - if (errind == false && total_axis > 0) + if (success_rtn == true && total_axis > 0) { brdptr->localaddr = (char *) NULL; brdptr->motor_in_motion = 0; diff --git a/motorApp/ImsSrc/drvIM483SM.cc b/motorApp/ImsSrc/drvIM483SM.cc index 5a60d813..b061da16 100644 --- a/motorApp/ImsSrc/drvIM483SM.cc +++ b/motorApp/ImsSrc/drvIM483SM.cc @@ -3,9 +3,9 @@ FILENAME... drvIM483SM.cc USAGE... Motor record driver level support for Intelligent Motion Systems, Inc. IM483(I/IE). -Version: $Revision: 1.3 $ +Version: $Revision: 1.4 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2003-05-19 17:10:22 $ +Last Modified: $Date: 2003-05-27 21:58:48 $ */ /***************************************************************** @@ -441,7 +441,7 @@ STATIC RTN_STATUS send_mess(int card, char const *com, char inchar) Debug(2, "send_mess(): message = %s\n", local_buff); cntrl = (struct IM483controller *) motor_state[card]->DevicePrivate; - serialIOSend(cntrl->serialInfo, local_buff, strlen(local_buff), SERIAL_TIMEOUT); + cntrl->serialInfo->serialIOSend(local_buff, strlen(local_buff), SERIAL_TIMEOUT); return(OK); } @@ -468,7 +468,7 @@ STATIC int recv_mess(int card, char *com, int flag) else timeout = SERIAL_TIMEOUT; - len = serialIORecv(cntrl->serialInfo, com, BUFF_SIZE, (char *) "\r\n", timeout); + len = cntrl->serialInfo->serialIORecv(com, BUFF_SIZE, (char *) "\r\n", timeout); if (len < 2) com[0] = '\0'; @@ -558,7 +558,7 @@ STATIC int motor_init() char buff[BUFF_SIZE]; int total_axis = 0; int status; - bool errind; + bool success_rtn; initialized = true; /* Indicate that driver is initialized. */ @@ -577,13 +577,11 @@ STATIC int motor_init() cntrl = (struct IM483controller *) brdptr->DevicePrivate; /* Initialize communications channel */ - errind = false; - cntrl->serialInfo = serialIOInit(cntrl->serial_card, - cntrl->serial_task); - if (cntrl->serialInfo == NULL) - errind = true; + success_rtn = false; + cntrl->serialInfo = new serialIO(cntrl->serial_card, + cntrl->serial_task, &success_rtn); - if (errind == false) + if (success_rtn == true) { int itera; char *src, *dest; @@ -642,7 +640,7 @@ STATIC int motor_init() } } - if (errind == false && status > 0) + if (success_rtn == true && status > 0) { brdptr->localaddr = (char *) NULL; brdptr->motor_in_motion = 0; diff --git a/motorApp/ImsSrc/drvMDrive.cc b/motorApp/ImsSrc/drvMDrive.cc index ffa73519..2a98a49b 100644 --- a/motorApp/ImsSrc/drvMDrive.cc +++ b/motorApp/ImsSrc/drvMDrive.cc @@ -3,9 +3,9 @@ FILENAME... drvMDrive.cc USAGE... Motor record driver level support for Intelligent Motion Systems, Inc. IM483(I/IE). -Version: $Revision: 1.4 $ +Version: $Revision: 1.5 $ Modified By: $Author: sluiter $ -Last Modified: $Date: 2003-05-23 19:42:46 $ +Last Modified: $Date: 2003-05-27 21:59:20 $ */ /* @@ -456,7 +456,7 @@ STATIC RTN_STATUS send_mess(int card, char const *com, char inchar) Debug(2, "send_mess(): message = %s\n", local_buff); cntrl = (struct IM483controller *) motor_state[card]->DevicePrivate; - serialIOSend(cntrl->serialInfo, local_buff, strlen(local_buff), SERIAL_TIMEOUT); + cntrl->serialInfo->serialIOSend(local_buff, strlen(local_buff), SERIAL_TIMEOUT); return(OK); } @@ -485,7 +485,7 @@ STATIC int recv_mess(int card, char *com, int flag) timeout = SERIAL_TIMEOUT; /* Get the response. */ - len = serialIORecv(cntrl->serialInfo, localbuf, BUFF_SIZE, (char *) "?", timeout); + len = cntrl->serialInfo->serialIORecv(localbuf, BUFF_SIZE, (char *) "?", timeout); if (len == 0) com[0] = '\0'; @@ -578,7 +578,7 @@ STATIC int motor_init() char buff[BUFF_SIZE]; int total_axis = 0; int status; - bool errind; + bool success_rtn; initialized = true; /* Indicate that driver is initialized. */ @@ -598,13 +598,11 @@ STATIC int motor_init() cntrl = (struct IM483controller *) brdptr->DevicePrivate; /* Initialize communications channel */ - errind = false; - cntrl->serialInfo = serialIOInit(cntrl->serial_card, - cntrl->serial_task); - if (cntrl->serialInfo == NULL) - errind = true; + success_rtn = false; + cntrl->serialInfo = new serialIO(cntrl->serial_card, + cntrl->serial_task, &success_rtn); - if (errind == false) + if (success_rtn == true) { /* Send a message to the board, see if it exists */ /* flush any junk at input port - should not be any data available */ @@ -632,7 +630,7 @@ STATIC int motor_init() brdptr->total_axis = total_axis; } - if (errind == false && total_axis > 0) + if (success_rtn == true && total_axis > 0) { brdptr->localaddr = (char *) NULL; brdptr->motor_in_motion = 0;