forked from epics_driver_modules/motorBase
Merge pull request #87 from epics-modules/gcc-fix
After testing these changes in MotorSrc and several drivers, this looks good to me.
This commit is contained in:
@@ -264,7 +264,7 @@ STATIC int set_status(int card, int signal)
|
||||
/* Test for post-move string. */
|
||||
if ((status.Bits.RA_DONE || ls_active == true) && nodeptr != 0 && nodeptr->postmsgptr != 0)
|
||||
{
|
||||
send_mess(card, nodeptr->postmsgptr, (char) NULL);
|
||||
send_mess(card, nodeptr->postmsgptr, (char*) NULL);
|
||||
/* The MCB4B always sends back a response, read it and discard */
|
||||
recv_mess(card, buff, WAIT);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
|
||||
@@ -404,7 +404,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strncpy(send_buff, nodeptr->postmsgptr, 80);
|
||||
send_mess(card, send_buff, (char) NULL);
|
||||
send_mess(card, send_buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
// get the axis status
|
||||
sprintf(buff, "AXISSTATUS()");
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
comm_status = recv_mess(card, buff, 1);
|
||||
if (comm_status > 0 && buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* get the axis fault status */
|
||||
sprintf(buff, "AXISFAULT()");
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
comm_status = recv_mess(card, buff, 1);
|
||||
axis_status = atoi(&buff[1]);
|
||||
status.Bits.RA_PLUS_LS = axis_status & CW_FAULT_BIT ? 1 : 0;
|
||||
@@ -285,7 +285,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
// get the position
|
||||
sprintf(buff, "PFBKPROG()");
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ static int set_status(int card, int signal)
|
||||
if ((status.Bits.RA_DONE || ls_active) && nodeptr != 0 && nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ static int motor_init()
|
||||
// we only care if we get a response
|
||||
// so we don't need to send a valid command
|
||||
strcpy(buff, "NONE");
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
|
||||
retry++;
|
||||
@@ -603,7 +603,7 @@ static int motor_init()
|
||||
brdptr->motor_in_motion = 0;
|
||||
// Read controller ID string
|
||||
strcpy(buff, "GETPARM(265)"); //UserString1
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -620,7 +620,7 @@ static int motor_init()
|
||||
{
|
||||
// Does this axis actually exist?
|
||||
sprintf(buff, "GETPARM(257)"); //AxisName
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
|
||||
// We know the axis exists if we got an ACK response
|
||||
@@ -645,7 +645,7 @@ static int motor_init()
|
||||
|
||||
// Determine if encoder present based on open/closed loop mode.
|
||||
sprintf(buff, "GETPARM(58)"); //CfgFbkPosType
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -658,7 +658,7 @@ static int motor_init()
|
||||
|
||||
// Determine if gains are supported based on the motor type.
|
||||
sprintf(buff, "GETPARM(33)"); //CfgMotType
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -671,12 +671,12 @@ static int motor_init()
|
||||
|
||||
// Stop all motors
|
||||
sprintf(buff, "ABORT");
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
|
||||
// Determine drive resolution
|
||||
sprintf(buff, "GETPARM(3)"); //PosScaleFactor
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -696,7 +696,7 @@ static int motor_init()
|
||||
|
||||
// Save home preset position
|
||||
sprintf(buff, "GETPARM(108)"); //HomeOffset
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -705,7 +705,7 @@ static int motor_init()
|
||||
|
||||
// Determine low limit
|
||||
sprintf(buff, "GETPARM(47)"); //ThresholdSoftCCW
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -714,7 +714,7 @@ static int motor_init()
|
||||
|
||||
// Determine high limit
|
||||
sprintf(buff, "GETPARM(48)"); //ThresholdSoftCW
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
@@ -723,7 +723,7 @@ static int motor_init()
|
||||
|
||||
// Save the HomeDirection parameter
|
||||
sprintf(buff, "GETPARM(106)"); //HomeDirection
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[0] == ASCII_ACK_CHAR)
|
||||
{
|
||||
|
||||
@@ -219,7 +219,7 @@ static int set_status(int card, int signal)
|
||||
status.Bits.EA_POSITION = (motorstat.word1.Bits.amp_enabled == YES) ? 1 : 0;
|
||||
|
||||
sprintf(outbuf, "M%.2d61", (signal + 1)); // Get Commanded Position.
|
||||
send_mess(card, outbuf, (char) NULL);
|
||||
send_mess(card, outbuf, (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
|
||||
motorData = atof(buff);
|
||||
@@ -269,7 +269,7 @@ static int set_status(int card, int signal)
|
||||
status.Bits.EA_HOME = 0;
|
||||
|
||||
sprintf(outbuf, "M%.2d62", (signal + 1));
|
||||
send_mess(card, outbuf, (char) NULL); // Get Actual Position.
|
||||
send_mess(card, outbuf, (char*) NULL); // Get Actual Position.
|
||||
recv_mess(card, buff, 1);
|
||||
motorData = atof(buff);
|
||||
motor_info->encoder_position = (int32_t) motorData;
|
||||
@@ -292,7 +292,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -833,10 +833,10 @@ static int motor_init()
|
||||
count = pmotor->response[0];
|
||||
}
|
||||
|
||||
send_mess(card_index, "TYPE", (char) NULL);
|
||||
send_mess(card_index, "TYPE", (char*) NULL);
|
||||
recv_mess(card_index, (char *) pmotorState->ident, 1);
|
||||
|
||||
send_mess(card_index, "VERSION", (char) NULL);
|
||||
send_mess(card_index, "VERSION", (char*) NULL);
|
||||
recv_mess(card_index, axis_pos, 1);
|
||||
strcat((char *) &pmotorState->ident, ", ");
|
||||
strcat((char *) &pmotorState->ident, axis_pos);
|
||||
@@ -849,7 +849,7 @@ static int motor_init()
|
||||
char outbuf[10];
|
||||
|
||||
sprintf(outbuf, "I%.2d00", (total_axis + 1));
|
||||
send_mess(card_index, outbuf, (char) NULL);
|
||||
send_mess(card_index, outbuf, (char*) NULL);
|
||||
recv_mess(card_index, axis_pos, 1);
|
||||
if (strcmp(axis_pos, "0") == 0)
|
||||
errind = true;
|
||||
@@ -860,12 +860,12 @@ static int motor_init()
|
||||
|
||||
// Set Ixx20=1 and Ixx21=0; control acceleration via Ixx19.
|
||||
sprintf(outbuf, "I%.2d20=1", (total_axis + 1));
|
||||
send_mess(card_index, outbuf, (char) NULL);
|
||||
send_mess(card_index, outbuf, (char*) NULL);
|
||||
sprintf(outbuf, "I%.2d21=0", (total_axis + 1));
|
||||
send_mess(card_index, outbuf, (char) NULL);
|
||||
send_mess(card_index, outbuf, (char*) NULL);
|
||||
|
||||
sprintf(outbuf, "I%.2d08", (total_axis + 1));
|
||||
send_mess(card_index, outbuf, (char) NULL);
|
||||
send_mess(card_index, outbuf, (char*) NULL);
|
||||
recv_mess(card_index, axis_pos, 1);
|
||||
cntrl->pos_scaleFac[total_axis] = atof(axis_pos) * 32.0;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr = motor_info->motor_motion;
|
||||
status.All = motor_info->status.All;
|
||||
|
||||
send_mess(card, "^", (char) NULL);
|
||||
send_mess(card, "^", (char*) NULL);
|
||||
rtn_state = recv_mess(card, buff, 1);
|
||||
if (rtn_state > 0)
|
||||
{
|
||||
@@ -273,7 +273,7 @@ static int set_status(int card, int signal)
|
||||
* Skip to substring for this motor, convert to double
|
||||
*/
|
||||
|
||||
send_mess(card, "Z 0", (char) NULL);
|
||||
send_mess(card, "Z 0", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
|
||||
motorData = atof(&buff[5]);
|
||||
@@ -295,7 +295,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
plusdir = (status.Bits.RA_DIRECTION) ? true : false;
|
||||
|
||||
send_mess(card, "] 0", (char) NULL);
|
||||
send_mess(card, "] 0", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
rtnval = atoi(&buff[5]);
|
||||
|
||||
@@ -318,7 +318,7 @@ static int set_status(int card, int signal)
|
||||
else
|
||||
status.Bits.RA_MINUS_LS = 0;
|
||||
|
||||
send_mess(card, "] 1", (char) NULL);
|
||||
send_mess(card, "] 1", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
rtnval = buff[5];
|
||||
|
||||
@@ -336,7 +336,7 @@ static int set_status(int card, int signal)
|
||||
motor_info->encoder_position = 0;
|
||||
else
|
||||
{
|
||||
send_mess(card, "z 0", (char) NULL);
|
||||
send_mess(card, "z 0", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
motorData = atof(&buff[5]);
|
||||
motor_info->encoder_position = (epicsInt32) motorData;
|
||||
@@ -359,7 +359,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -551,9 +551,9 @@ static int motor_init()
|
||||
/* flush any junk at input port - should not be any data available */
|
||||
pasynOctetSyncIO->flush(cntrl->pasynUser);
|
||||
|
||||
send_mess(card_index, "\003", (char) NULL); /* Reset device. */
|
||||
send_mess(card_index, "\003", (char*) NULL); /* Reset device. */
|
||||
epicsThreadSleep(1.0);
|
||||
send_mess(card_index, " ", (char) NULL);
|
||||
send_mess(card_index, " ", (char*) NULL);
|
||||
|
||||
/* Save controller identification message. */
|
||||
src = buff;
|
||||
|
||||
@@ -221,7 +221,7 @@ static int set_status(int card, int signal)
|
||||
charcnt = recv_mess(card, buff, FLUSH);
|
||||
|
||||
sprintf(buff,"STR1/%d",(signal + 1));
|
||||
send_mess(card, buff, (char) NULL); /* Tell Status */
|
||||
send_mess(card, buff, (char*) NULL); /* Tell Status */
|
||||
charcnt = recv_mess(card, buff, 1);
|
||||
convert_cnt = sscanf(buff, "C\tSTR%d\t1\t%d\t%d\t%d\t%d\t%d\t%d\t%d",
|
||||
&str_axis, &str_move, &str_norg, &str_orgg,
|
||||
@@ -256,7 +256,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Parse motor position */
|
||||
sprintf(buff,"RDP%d/0", (signal + 1));
|
||||
send_mess(card, buff, (char) NULL); /* Tell Position */
|
||||
send_mess(card, buff, (char*) NULL); /* Tell Position */
|
||||
recv_mess(card, buff, 1);
|
||||
convert_cnt = sscanf(buff, "C\tRDP%d\t%d", &str_axis, &motorData);
|
||||
|
||||
@@ -285,7 +285,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Torque enabled? */
|
||||
sprintf(buff,"RSY%d/21", (signal + 1));
|
||||
send_mess(card, buff, (char) NULL); /* Tell Position */
|
||||
send_mess(card, buff, (char*) NULL); /* Tell Position */
|
||||
recv_mess(card, buff, 1);
|
||||
convert_cnt = sscanf(buff, "C\tRSY%d\t21\t%d", &str_axis, &str_move);
|
||||
status.Bits.EA_POSITION = (str_move == 0) ? 1 : 0;
|
||||
@@ -327,7 +327,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ STATIC int set_status(int card, int signal)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
strcat(buff, "\r");
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
/* The Micos will not send back a response for a 'set' command, don't need next line */
|
||||
/* recv_mess(card, buff, WAIT); */
|
||||
nodeptr->postmsgptr = NULL;
|
||||
|
||||
@@ -306,7 +306,7 @@ static int set_status(int card, int signal)
|
||||
statusStr[0] = positionStr[0] = buff[0] = '\0';
|
||||
|
||||
sprintf(buff, "%d ST", (signal + 1));
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
rtn_state = recv_mess(card, buff, 1);
|
||||
if (rtn_state > 0)
|
||||
{
|
||||
@@ -342,7 +342,7 @@ static int set_status(int card, int signal)
|
||||
status.Bits.RA_DONE = !mstat.Bits.inMotion;
|
||||
|
||||
sprintf(buff, "%d POS", (signal + 1));
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
|
||||
/*
|
||||
@@ -433,7 +433,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ static int motor_init()
|
||||
do
|
||||
{
|
||||
sprintf(buff, "%d ST", (total_axis + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
} while (status <= 0 && retry < 3);
|
||||
@@ -666,11 +666,11 @@ static int motor_init()
|
||||
|
||||
/* stop and initialize the controller */
|
||||
sprintf(buff, "%d V 0", (motor_index + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
sprintf(buff, "%d HO", (motor_index + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
sprintf(buff, "%d EN", (motor_index + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
|
||||
motor_info->status.All = 0;
|
||||
motor_info->no_motion_count = 0;
|
||||
@@ -689,7 +689,7 @@ static int motor_init()
|
||||
limitStr[0] = '\0';
|
||||
/* Determine low limit */
|
||||
sprintf(buff, "%d LL -", (motor_index + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
strncat(limitStr, &buff[5], 8);
|
||||
motor_info->low_limit = (epicsInt32) strtoul(limitStr, NULL, 16);
|
||||
@@ -697,7 +697,7 @@ static int motor_init()
|
||||
limitStr[0] = '\0';
|
||||
/* Determine high limit */
|
||||
sprintf(buff, "%d LL", (motor_index + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
strncat(limitStr, &buff[5], 8);
|
||||
motor_info->high_limit = (epicsInt32) strtoul(limitStr, NULL, 16);
|
||||
@@ -715,7 +715,7 @@ static int motor_init()
|
||||
epicsThreadSleep(0.2);
|
||||
|
||||
sprintf(buff, "%d HO", (motor_index + 1));
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
|
||||
set_status(card_index, motor_index); /* Read status of each
|
||||
* motor */
|
||||
|
||||
@@ -462,9 +462,9 @@ epicsShareFunc long motor_start_trans_com(struct motorRecord *mr, struct board_s
|
||||
motor_call->signal = axis;
|
||||
motor_call->type = UNDEFINED;
|
||||
motor_call->mrecord = (struct dbCommon *) mr;
|
||||
motor_call->message[0] = (char) NULL;
|
||||
motor_call->postmsgptr = (char) NULL;
|
||||
motor_call->termstring = (char) NULL;
|
||||
motor_call->message[0] = (char) NULL;
|
||||
motor_call->postmsgptr = (char*) NULL;
|
||||
motor_call->termstring = (char*) NULL;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ static int set_status(int card, int signal)
|
||||
status.All = motor_info->status.All;
|
||||
|
||||
sprintf(outbuff, "%.2dMD", signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
|
||||
if (charcnt == 1 && (inbuff[0] == '0' || inbuff[0] == '1'))
|
||||
@@ -255,7 +255,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Get motor position. */
|
||||
sprintf(outbuff, READ_POSITION, signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
|
||||
motorData = atof(inbuff) / cntrl->drive_resolution[signal];
|
||||
@@ -279,7 +279,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Get travel limit switch status. */
|
||||
sprintf(outbuff, "%.2dPH", signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
cptr = strchr(inbuff, 'H');
|
||||
if (cptr == NULL)
|
||||
@@ -318,7 +318,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Get motor power on/off status. */
|
||||
sprintf(outbuff, "%.2dMO?", signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
power = atoi(inbuff) ? true : false;
|
||||
|
||||
@@ -331,7 +331,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Get error code. */
|
||||
sprintf(outbuff, "%.2dTE?", signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
errcode = atoi(inbuff);
|
||||
if (errcode != 0)
|
||||
@@ -358,7 +358,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(outbuff, nodeptr->postmsgptr);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ static int motor_init()
|
||||
|
||||
do
|
||||
{
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
/* Return value is length of response string */
|
||||
@@ -652,7 +652,7 @@ errexit:
|
||||
brdptr->motor_in_motion = 0;
|
||||
strcpy(brdptr->ident, &buff[1]); /* Skip "\n" */
|
||||
|
||||
send_mess(card_index, "ZU", (char) NULL);
|
||||
send_mess(card_index, "ZU", (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
total_axis = buff[0] >> 4;
|
||||
if (total_axis > 4)
|
||||
@@ -664,7 +664,7 @@ errexit:
|
||||
for (motor_index = 0; motor_index < total_axis; motor_index++)
|
||||
{
|
||||
sprintf(buff, STOP_AXIS, motor_index + 1); /* Stop motor */
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
/* Initialize. */
|
||||
brdptr->motor_info[motor_index].motor_motion = NULL;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ STATIC int set_status(int card, int signal)
|
||||
status.All = motor_info->status.All;
|
||||
|
||||
sprintf(outbuff, "%dMS", signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
if (charcnt > 0)
|
||||
{
|
||||
@@ -310,7 +310,7 @@ STATIC int set_status(int card, int signal)
|
||||
status.Bits.EA_HOME = 0;
|
||||
|
||||
sprintf(outbuff, "%dTP", signal + 1);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
charcnt = recv_mess(card, inbuff, 1);
|
||||
if (charcnt > 0)
|
||||
{
|
||||
@@ -373,7 +373,7 @@ STATIC int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(outbuff, nodeptr->postmsgptr);
|
||||
send_mess(card, outbuff, (char) NULL);
|
||||
send_mess(card, outbuff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -631,7 +631,7 @@ STATIC int motor_init()
|
||||
/* flush any junk at input port - should not be any data available */
|
||||
pasynOctetSyncIO->flush(cntrl->pasynUser);
|
||||
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, axis_pos, 1);
|
||||
/* Return value is length of response string */
|
||||
}
|
||||
@@ -640,12 +640,12 @@ STATIC int motor_init()
|
||||
{
|
||||
brdptr->localaddr = (char *) NULL;
|
||||
brdptr->motor_in_motion = 0;
|
||||
send_mess(card_index, STOP_ALL, (char) NULL); /* Stop all motors */
|
||||
send_mess(card_index, GET_IDENT, (char) NULL); /* Read controller ID string */
|
||||
send_mess(card_index, STOP_ALL, (char*) NULL); /* Stop all motors */
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL); /* Read controller ID string */
|
||||
recv_mess(card_index, buff, 1);
|
||||
strncpy(brdptr->ident, &buff[0], MAX_IDENT_LEN); /* Skip "VE" */
|
||||
|
||||
send_mess(card_index, "RC", (char) NULL);
|
||||
send_mess(card_index, "RC", (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
bufptr = epicsStrtok_r(buff, "=", &tok_save);
|
||||
bufptr = epicsStrtok_r(NULL, " ", &tok_save);
|
||||
@@ -692,7 +692,7 @@ STATIC int motor_init()
|
||||
else
|
||||
{
|
||||
sprintf(buff, "%dTPE", motor_index + 1);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
|
||||
if (strcmp(buff, "E01") == 0)
|
||||
|
||||
@@ -259,14 +259,14 @@ static void start_status(int card)
|
||||
if (card >= 0)
|
||||
{
|
||||
cntrl = (struct MMcontroller *) motor_state[card]->DevicePrivate;
|
||||
send_mess(card, READ_STATUS, (char) NULL);
|
||||
send_mess(card, READ_STATUS, (char*) NULL);
|
||||
status = recv_mess(card, cntrl->status_string, 1);
|
||||
if (status > 0)
|
||||
{
|
||||
cntrl->status = NORMAL;
|
||||
send_mess(card, READ_POSITION, (char) NULL);
|
||||
send_mess(card, READ_POSITION, (char*) NULL);
|
||||
recv_mess(card, cntrl->position_string, 1);
|
||||
send_mess(card, READ_FEEDBACK, (char) NULL);
|
||||
send_mess(card, READ_FEEDBACK, (char*) NULL);
|
||||
recv_mess(card, cntrl->feedback_string, 1);
|
||||
}
|
||||
else
|
||||
@@ -284,7 +284,7 @@ static void start_status(int card)
|
||||
* responses. This minimizes the latency due to processing on each card
|
||||
*/
|
||||
for (itera = 0; (itera < total_cards) && motor_state[itera]; itera++)
|
||||
send_mess(itera, READ_STATUS, (char) NULL);
|
||||
send_mess(itera, READ_STATUS, (char*) NULL);
|
||||
for (itera = 0; (itera < total_cards) && motor_state[itera]; itera++)
|
||||
{
|
||||
cntrl = (struct MMcontroller *) motor_state[itera]->DevicePrivate;
|
||||
@@ -292,7 +292,7 @@ static void start_status(int card)
|
||||
if (status > 0)
|
||||
{
|
||||
cntrl->status = NORMAL;
|
||||
send_mess(itera, READ_FEEDBACK, (char) NULL);
|
||||
send_mess(itera, READ_FEEDBACK, (char*) NULL);
|
||||
recv_mess(itera, cntrl->feedback_string, 1);
|
||||
}
|
||||
else
|
||||
@@ -304,7 +304,7 @@ static void start_status(int card)
|
||||
}
|
||||
}
|
||||
for (itera = 0; (itera < total_cards) && motor_state[itera]; itera++)
|
||||
send_mess(itera, READ_POSITION, (char) NULL);
|
||||
send_mess(itera, READ_POSITION, (char*) NULL);
|
||||
for (itera = 0; (itera < total_cards) && motor_state[itera]; itera++)
|
||||
{
|
||||
cntrl = (struct MMcontroller *) motor_state[itera]->DevicePrivate;
|
||||
@@ -388,7 +388,7 @@ static int set_status(int card, int signal)
|
||||
if (motor_info->pid_present == YES && drvMM4000ReadbackDelay != 0)
|
||||
{
|
||||
epicsThreadSleep((double) drvMM4000ReadbackDelay/1000.0);
|
||||
send_mess(card, READ_STATUS, (char) NULL);
|
||||
send_mess(card, READ_STATUS, (char*) NULL);
|
||||
recv_mess(card, cntrl->status_string, 1);
|
||||
pos = signal*5 + 3; /* Offset in status string */
|
||||
mstat.All = cntrl->status_string[pos];
|
||||
@@ -469,7 +469,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
|
||||
/* Check for controller error. */
|
||||
send_mess(card, "TE;", (char) NULL);
|
||||
send_mess(card, "TE;", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
if (buff[2] == '@')
|
||||
status.Bits.RA_PROBLEM = 0;
|
||||
@@ -496,7 +496,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ static int motor_init()
|
||||
|
||||
do
|
||||
{
|
||||
send_mess(card_index, READ_POSITION, (char) NULL);
|
||||
send_mess(card_index, READ_POSITION, (char*) NULL);
|
||||
status = recv_mess(card_index, axis_pos, 1);
|
||||
retry++;
|
||||
/* Return value is length of response string */
|
||||
@@ -719,8 +719,8 @@ static int motor_init()
|
||||
{
|
||||
brdptr->localaddr = (char *) NULL;
|
||||
brdptr->motor_in_motion = 0;
|
||||
send_mess(card_index, STOP_ALL, (char) NULL); /* Stop all motors */
|
||||
send_mess(card_index, GET_IDENT, (char) NULL); /* Read controller ID string */
|
||||
send_mess(card_index, STOP_ALL, (char*) NULL); /* Stop all motors */
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL); /* Read controller ID string */
|
||||
recv_mess(card_index, buff, 1);
|
||||
strcpy(brdptr->ident, &buff[2]); /* Skip "VE" */
|
||||
|
||||
@@ -744,7 +744,7 @@ static int motor_init()
|
||||
continue;
|
||||
}
|
||||
|
||||
send_mess(card_index, READ_POSITION, (char) NULL);
|
||||
send_mess(card_index, READ_POSITION, (char*) NULL);
|
||||
recv_mess(card_index, axis_pos, 1);
|
||||
|
||||
/* The return string will tell us how many axes this controller has */
|
||||
@@ -769,7 +769,7 @@ static int motor_init()
|
||||
|
||||
/* Determine if encoder present based on open/closed loop mode. */
|
||||
sprintf(buff, "%dTC", motor_index + 1);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
loop_state = atoi(&buff[3]); /* Skip first 3 characters */
|
||||
if (loop_state != 0)
|
||||
@@ -781,7 +781,7 @@ static int motor_init()
|
||||
|
||||
/* Determine drive resolution. */
|
||||
sprintf(buff, "%dTU", motor_index + 1);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
cntrl->drive_resolution[motor_index] = atof(&buff[3]);
|
||||
|
||||
@@ -792,19 +792,19 @@ static int motor_init()
|
||||
|
||||
/* Save home preset position. */
|
||||
sprintf(buff, "%dXH", motor_index + 1);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
cntrl->home_preset[motor_index] = atof(&buff[3]);
|
||||
|
||||
/* Determine low limit */
|
||||
sprintf(buff, "%dTL", motor_index + 1);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
motor_info->low_limit = atof(&buff[3]);
|
||||
|
||||
/* Determine high limit */
|
||||
sprintf(buff, "%dTR", motor_index + 1);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
motor_info->high_limit = atof(&buff[3]);
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Request the status and position of this motor */
|
||||
sprintf(buff, "%sR", axis_name);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
rtnval = recv_mess(card, response, 1);
|
||||
if (rtnval > 0)
|
||||
{
|
||||
@@ -286,7 +286,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
/* Set Motor On/Off status */
|
||||
sprintf(buff, "%sM?", axis_name);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
rtnval = recv_mess(card, response, 1);
|
||||
status.Bits.EA_POSITION = (int) atof(&response[2]);
|
||||
|
||||
@@ -336,7 +336,7 @@ static int set_status(int card, int signal)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
strcat(buff, "\r");
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ static int motor_init()
|
||||
pasynOctetSyncIO->flush(cntrl->pasynUser);
|
||||
|
||||
/* Send a SCUM 1 command to put device in this mode. */
|
||||
send_mess(card_index, "SCUM 1", (char) NULL);
|
||||
send_mess(card_index, "SCUM 1", (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
|
||||
/* Set up basic controller parameters
|
||||
@@ -564,12 +564,12 @@ static int motor_init()
|
||||
* Bit 13=0, Eearly serial poll mapping
|
||||
* Bit 14=0, No SRQ assertion
|
||||
*/
|
||||
send_mess(card_index, "SENAINT $AF", (char) NULL);
|
||||
send_mess(card_index, "SENAINT $AF", (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
|
||||
/* Send a message and read response from controller to see if
|
||||
* it exists */
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
/* Return value is length of response string */
|
||||
}
|
||||
@@ -578,7 +578,7 @@ static int motor_init()
|
||||
{
|
||||
brdptr->localaddr = (char *) NULL;
|
||||
brdptr->motor_in_motion = 0;
|
||||
send_mess(card_index, GET_IDENT, (char) NULL); /* Read controller ID string */
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL); /* Read controller ID string */
|
||||
recv_mess(card_index, buff, 1);
|
||||
strncpy(brdptr->ident, &buff[2], 50); /* Skip "XD" */
|
||||
|
||||
@@ -589,7 +589,7 @@ static int motor_init()
|
||||
int axis_name = (int) *PM500_axis_names[total_axis];
|
||||
brdptr->motor_info[total_axis].motor_motion = NULL;
|
||||
sprintf(buff, "%cSTAT?", axis_name);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
if (buff[1] == 'E')
|
||||
break;
|
||||
@@ -614,7 +614,7 @@ static int motor_init()
|
||||
double res = 0.0;
|
||||
|
||||
sprintf(buff, "%sCONFIG?", axis_name);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
recv_mess(card_index, buff, 1);
|
||||
firmware = &buff[8];
|
||||
Debug(3, "motor_init: firmware = %s\n", firmware);
|
||||
|
||||
@@ -264,7 +264,7 @@ RTN_STATUS oms_build_trans(motor_cmnd command, double *parms, struct motorRecord
|
||||
char respbuf[10];
|
||||
|
||||
(*tabptr->getmsg)(card, respbuf, -1);
|
||||
(*tabptr->sendmsg)(card, "RB\r", (char) NULL);
|
||||
(*tabptr->sendmsg)(card, "RB\r", (char*) NULL);
|
||||
(*tabptr->getmsg)(card, respbuf, 1);
|
||||
if (sscanf(respbuf, "%x", &response) == 0)
|
||||
response = 0; /* Force an error. */
|
||||
|
||||
@@ -396,7 +396,7 @@ static int set_status(int card, int signal)
|
||||
errlogPrintf(wdctrmsg, card, q_buf);
|
||||
status.Bits.RA_PROBLEM = 1;
|
||||
motor_info->status.All = status.All;
|
||||
send_mess(card, STOP_ALL, (char) NULL);
|
||||
send_mess(card, STOP_ALL, (char*) NULL);
|
||||
/* Disable board. */
|
||||
motor_state[card] = (struct controller *) NULL;
|
||||
return(rtn_state = 1); /* End move. */
|
||||
@@ -1261,8 +1261,8 @@ static int motor_init()
|
||||
pmotor->status1_irq_enable.All = 0;
|
||||
pmotor->status2_irq_enable = 0;
|
||||
|
||||
send_mess(card_index, ERROR_CLEAR, (char) NULL);
|
||||
send_mess(card_index, STOP_ALL, (char) NULL);
|
||||
send_mess(card_index, ERROR_CLEAR, (char*) NULL);
|
||||
send_mess(card_index, STOP_ALL, (char*) NULL);
|
||||
|
||||
rtn_code = send_recv_mess(card_index, GET_IDENT, (char) NULL, (char *) pmotorState->ident, 1);
|
||||
if (rtn_code != 0)
|
||||
@@ -1293,7 +1293,7 @@ static int motor_init()
|
||||
|
||||
if (wdtrip == false)
|
||||
{
|
||||
send_mess(card_index, initstring[card_index], (char) NULL);
|
||||
send_mess(card_index, initstring[card_index], (char*) NULL);
|
||||
|
||||
send_recv_mess(card_index, ALL_POS, (char) NULL, axis_pos, 1);
|
||||
|
||||
|
||||
@@ -1170,16 +1170,16 @@ static int motor_init()
|
||||
irqdata->irqEnable = FALSE;
|
||||
pmotor->control = IRQ_RESET_ID;
|
||||
|
||||
send_mess(card_index, "EF", (char) NULL);
|
||||
send_mess(card_index, ERROR_CLEAR, (char) NULL);
|
||||
send_mess(card_index, STOP_ALL, (char) NULL);
|
||||
send_mess(card_index, "EF", (char*) NULL);
|
||||
send_mess(card_index, ERROR_CLEAR, (char*) NULL);
|
||||
send_mess(card_index, STOP_ALL, (char*) NULL);
|
||||
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
|
||||
recv_mess(card_index, (char *) pmotorState->ident, 1);
|
||||
Debug(3, "Identification = %s\n", pmotorState->ident);
|
||||
|
||||
send_mess(card_index, ALL_POS, (char) NULL);
|
||||
send_mess(card_index, ALL_POS, (char*) NULL);
|
||||
recv_mess(card_index, axis_pos, 1);
|
||||
|
||||
for (total_axis = 0, pos_ptr = epicsStrtok_r(axis_pos, ",", &tok_save);
|
||||
|
||||
@@ -1196,15 +1196,15 @@ static int motor_init()
|
||||
pmotor->control.cntrlReg = 0; /* Disable all interrupts */
|
||||
pmotor->rebootind = 0x4321; /* Set reboot indicator (before send_mess call). */
|
||||
|
||||
send_mess(card_index, "EF", (char) NULL);
|
||||
send_mess(card_index, ERROR_CLEAR, (char) NULL);
|
||||
send_mess(card_index, STOP_ALL, (char) NULL);
|
||||
send_mess(card_index, "EF", (char*) NULL);
|
||||
send_mess(card_index, ERROR_CLEAR, (char*) NULL);
|
||||
send_mess(card_index, STOP_ALL, (char*) NULL);
|
||||
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
recv_mess(card_index, (char *) pmotorState->ident, 1);
|
||||
Debug(3, "Identification = %s\n", pmotorState->ident);
|
||||
|
||||
send_mess(card_index, ALL_POS, (char) NULL);
|
||||
send_mess(card_index, ALL_POS, (char*) NULL);
|
||||
recv_mess(card_index, axis_pos, 1);
|
||||
|
||||
for (total_axis = 0, pos_ptr = epicsStrtok_r(axis_pos, ",", &tok_save);
|
||||
|
||||
@@ -770,7 +770,7 @@ static int motor_init()
|
||||
/* Try 3 times to connect to controller. */
|
||||
do
|
||||
{
|
||||
send_mess (card_index, GET_IDENT, (char) NULL);
|
||||
send_mess (card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, (char *) pmotorState->ident, 1);
|
||||
retry++;
|
||||
} while (status == 0 && retry < 3);
|
||||
@@ -783,11 +783,11 @@ static int motor_init()
|
||||
pmotorState->motor_in_motion = 0;
|
||||
pmotorState->cmnd_response = false;
|
||||
|
||||
send_mess (card_index, ECHO_OFF, (char) NULL);
|
||||
send_mess (card_index, ERROR_CLEAR, (char) NULL);
|
||||
send_mess (card_index, STOP_ALL, (char) NULL);
|
||||
send_mess (card_index, ECHO_OFF, (char*) NULL);
|
||||
send_mess (card_index, ERROR_CLEAR, (char*) NULL);
|
||||
send_mess (card_index, STOP_ALL, (char*) NULL);
|
||||
|
||||
send_mess (card_index, ALL_POS, (char) NULL);
|
||||
send_mess (card_index, ALL_POS, (char*) NULL);
|
||||
recv_mess (card_index, axis_pos, 1);
|
||||
|
||||
for (total_axis = 0, pos_ptr = epicsStrtok_r(axis_pos, ",", &tok_save);
|
||||
@@ -822,7 +822,7 @@ static int motor_init()
|
||||
* dummy communication transaction.
|
||||
*/
|
||||
|
||||
send_mess (card_index, ALL_POS, (char) NULL);
|
||||
send_mess (card_index, ALL_POS, (char*) NULL);
|
||||
recv_mess (card_index, axis_pos, 1);
|
||||
|
||||
for (motor_index=0;motor_index<total_axis;motor_index++)
|
||||
|
||||
@@ -381,7 +381,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strncpy(send_buff, nodeptr->postmsgptr, 80);
|
||||
send_mess(card, send_buff, (char) NULL);
|
||||
send_mess(card, send_buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strncpy(send_buff, nodeptr->postmsgptr, 80);
|
||||
send_mess(card, send_buff, (char) NULL);
|
||||
send_mess(card, send_buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -704,12 +704,12 @@ PC6KUpLoad(int card, /* Controller Number */
|
||||
/* Copy file into PC6K Program */
|
||||
sprintf(nextLine, "DEL %s", progName);
|
||||
// recvCnt = send_recv_mess(card, nextLine, replyBuff);
|
||||
send_mess(card, nextLine, (char) NULL);
|
||||
send_mess(card, nextLine, (char*) NULL);
|
||||
// eos_ptr = eos_str;
|
||||
sprintf(nextLine, "DEF %s", progName);
|
||||
// recvCnt = send_recv_mess(card, nextLine, replyBuff, eos_ptr);
|
||||
// recvCnt = send_recv_mess(card, nextLine, replyBuff);
|
||||
send_mess(card, nextLine, (char) NULL);
|
||||
send_mess(card, nextLine, (char*) NULL);
|
||||
}
|
||||
|
||||
while (fgets(nextLine, BUFF_SIZE, fd) != NULL)
|
||||
@@ -721,7 +721,7 @@ PC6KUpLoad(int card, /* Controller Number */
|
||||
|
||||
// recvCnt = send_recv_mess(card, nextLine, replyBuff, eos_ptr);
|
||||
// recvCnt = send_recv_mess(card, nextLine, replyBuff);
|
||||
send_mess(card, nextLine, (char) NULL);
|
||||
send_mess(card, nextLine, (char*) NULL);
|
||||
}
|
||||
|
||||
fclose(fd);
|
||||
@@ -729,7 +729,7 @@ PC6KUpLoad(int card, /* Controller Number */
|
||||
if (progName && strlen(progName))
|
||||
/* End PC6K Program */
|
||||
// recvCnt = send_recv_mess(card, "END", replyBuff);
|
||||
send_mess(card, "END", (char) NULL);
|
||||
send_mess(card, "END", (char*) NULL);
|
||||
|
||||
return(OK);
|
||||
}
|
||||
@@ -832,7 +832,7 @@ static int motor_init()
|
||||
} while (!recvCnt && ++retryCnt < 3);
|
||||
|
||||
|
||||
/* send_mess(card_index, COMEXEC_ENA, (char) NULL); */ /* Enable continuous commands */
|
||||
/* send_mess(card_index, COMEXEC_ENA, (char*) NULL); */ /* Enable continuous commands */
|
||||
send_recv_mess(card_index, COMEXEC_ENA, buff); /* Enable continuous commands */
|
||||
// send_recv_mess(card_index, CMD_SCALE, buff); /* Enable scaling - unary */
|
||||
|
||||
|
||||
@@ -390,7 +390,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ static int motor_init()
|
||||
{
|
||||
online = false;
|
||||
/* Set Controller to ONLINE mode */
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
if ((status = recv_mess(card_index, buff, 1)))
|
||||
online = (strstr(buff,"DSM")) ? true : false;
|
||||
else
|
||||
|
||||
@@ -231,7 +231,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr = motor_info->motor_motion;
|
||||
status.All = motor_info->status.All;
|
||||
|
||||
send_mess(card, GET_STATUS, (char) NULL);
|
||||
send_mess(card, GET_STATUS, (char*) NULL);
|
||||
comm_status = recv_mess(card, buff, 1);
|
||||
if (comm_status == 0)
|
||||
{
|
||||
@@ -270,7 +270,7 @@ static int set_status(int card, int signal)
|
||||
* Skip to substring for this motor, convert to double
|
||||
*/
|
||||
|
||||
send_mess(card, GET_POS, (char) NULL);
|
||||
send_mess(card, GET_POS, (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
|
||||
motorData = NINT (atof(buff) / cntrl->drive_resolution);
|
||||
@@ -339,7 +339,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ static int motor_init()
|
||||
|
||||
do
|
||||
{
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
} while (status == 0 && retry < 3);
|
||||
@@ -557,7 +557,7 @@ static int motor_init()
|
||||
|
||||
|
||||
/* Set Controller to REMOTE mode */
|
||||
send_mess(card_index, REMOTE_MODE, (char) NULL);
|
||||
send_mess(card_index, REMOTE_MODE, (char*) NULL);
|
||||
|
||||
{
|
||||
struct mess_info *motor_info = &brdptr->motor_info[0];
|
||||
|
||||
@@ -214,7 +214,7 @@ static int set_status(int card, int signal)
|
||||
if (cntrl->status != NORMAL)
|
||||
charcnt = recv_mess(card, buff, FLUSH);
|
||||
|
||||
send_mess(card, "TS", (char) NULL); /* Tell Status */
|
||||
send_mess(card, "TS", (char*) NULL); /* Tell Status */
|
||||
charcnt = recv_mess(card, buff, 1);
|
||||
if (charcnt > 9)
|
||||
convert_cnt = sscanf(buff, "S:%2hx %2hx %2hx\n",
|
||||
@@ -255,7 +255,7 @@ static int set_status(int card, int signal)
|
||||
minusLS = mstat2.Bits.lo_limit ? 0 : 1;
|
||||
|
||||
/* Parse motor position */
|
||||
send_mess(card, "TP", (char) NULL); /* Tell Position */
|
||||
send_mess(card, "TP", (char*) NULL); /* Tell Position */
|
||||
recv_mess(card, buff, 1);
|
||||
motorData = NINT(atof(&buff[2]));
|
||||
|
||||
@@ -309,7 +309,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ static int motor_init()
|
||||
do
|
||||
{
|
||||
sprintf(buff,"\001%1XVE", cntrl->asyn_address);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
} while (status == 0 && retry < 3);
|
||||
|
||||
@@ -264,7 +264,7 @@ static int set_status(int card, int signal)
|
||||
cntrl->status = NORMAL;
|
||||
status.Bits.CNTRL_COMM_ERR = 0;
|
||||
|
||||
send_mess(card, "MOT:COND?", (char) NULL);
|
||||
send_mess(card, "MOT:COND?", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
|
||||
mstat.All = atoi(&buff[0]);
|
||||
@@ -295,7 +295,7 @@ static int set_status(int card, int signal)
|
||||
* Skip to substring for this motor, convert to double
|
||||
*/
|
||||
|
||||
send_mess(card, "CURR:TPOS?", (char) NULL);
|
||||
send_mess(card, "CURR:TPOS?", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
|
||||
motorData = atof(buff);
|
||||
@@ -364,7 +364,7 @@ static int set_status(int card, int signal)
|
||||
status.Bits.EA_SLIP_STALL = 0;
|
||||
status.Bits.EA_HOME = 0;
|
||||
|
||||
send_mess(card, "AXIS:POS?", (char) NULL);
|
||||
send_mess(card, "AXIS:POS?", (char*) NULL);
|
||||
recv_mess(card, buff, 1);
|
||||
motorData = atof(buff);
|
||||
motor_info->encoder_position = (epicsInt32) motorData;
|
||||
@@ -387,7 +387,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@ static int motor_init()
|
||||
|
||||
do
|
||||
{
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
} while (status == 0 && retry < 3);
|
||||
|
||||
@@ -341,7 +341,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ static int motor_init()
|
||||
|
||||
do
|
||||
{
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
} while (status == 0 && retry < 3);
|
||||
|
||||
@@ -225,7 +225,7 @@ static int set_status(int card, int signal)
|
||||
if (cntrl->status != NORMAL)
|
||||
charcnt = recv_mess(card, buff, FLUSH);
|
||||
|
||||
send_mess(card, "TS", (char) NULL); /* Tell Status */
|
||||
send_mess(card, "TS", (char*) NULL); /* Tell Status */
|
||||
charcnt = recv_mess(card, buff, 1);
|
||||
if (charcnt > 18)
|
||||
convert_cnt = sscanf(buff, "S:%2hx %2hx %2hx %2hx %2hx %2hx\n",
|
||||
@@ -281,7 +281,7 @@ static int set_status(int card, int signal)
|
||||
|
||||
|
||||
/* Parse motor position */
|
||||
send_mess(card, "TP", (char) NULL); /* Tell Position */
|
||||
send_mess(card, "TP", (char*) NULL); /* Tell Position */
|
||||
recv_mess(card, buff, 1);
|
||||
motorData = NINT(atof(&buff[2]));
|
||||
|
||||
@@ -335,7 +335,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ static int motor_init()
|
||||
do
|
||||
{
|
||||
sprintf(buff,"\001%1XVE", cntrl->asyn_address);
|
||||
send_mess(card_index, buff, (char) NULL);
|
||||
send_mess(card_index, buff, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
retry++;
|
||||
} while (status == 0 && retry < 3);
|
||||
|
||||
@@ -243,14 +243,14 @@ static int set_status(int card, int signal)
|
||||
recv_mess(card, buff, FLUSH);
|
||||
|
||||
readOK = false;
|
||||
send_mess(card, READ_ONLINE, (char) NULL);
|
||||
send_mess(card, READ_ONLINE, (char*) NULL);
|
||||
if (recv_mess(card, buff, 1) && sscanf(buff, "%d", &online_status))
|
||||
{
|
||||
if (!online_status)
|
||||
{
|
||||
/* Assume Controller Reboot - Set ONLINE and Velocity Control ON */
|
||||
send_mess(card, SET_ONLINE, (char) NULL);
|
||||
send_mess(card, SET_VELCTRL, (char) NULL);
|
||||
send_mess(card, SET_ONLINE, (char*) NULL);
|
||||
send_mess(card, SET_VELCTRL, (char*) NULL);
|
||||
}
|
||||
|
||||
send_mess(card, READ_ONTARGET, PIE516_axis[signal]);
|
||||
@@ -367,7 +367,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -585,15 +585,15 @@ static int motor_init()
|
||||
{
|
||||
online = false;
|
||||
/* Set Controller to ONLINE mode */
|
||||
send_mess(card_index, SET_ONLINE, (char) NULL);
|
||||
send_mess(card_index, READ_ONLINE, (char) NULL);
|
||||
send_mess(card_index, SET_ONLINE, (char*) NULL);
|
||||
send_mess(card_index, READ_ONLINE, (char*) NULL);
|
||||
if ((status = recv_mess(card_index, buff, 1)))
|
||||
online = (atoi(buff)==1) ? true : false;
|
||||
else
|
||||
retry++;
|
||||
} while (online == false && retry < 3);
|
||||
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
|
||||
/* Parse out E516 revision (2 decimal places) and convert to int */
|
||||
@@ -626,7 +626,7 @@ static int motor_init()
|
||||
brdptr->total_axis = total_axis;
|
||||
|
||||
/* Turn ON velocity control mode - All axis */
|
||||
send_mess(card_index, SET_VELCTRL, (char) NULL);
|
||||
send_mess(card_index, SET_VELCTRL, (char*) NULL);
|
||||
|
||||
for (motor_index = 0; motor_index < total_axis; motor_index++)
|
||||
{
|
||||
|
||||
@@ -256,7 +256,7 @@ static int set_status(int card, int signal)
|
||||
// {
|
||||
// /* Assume Controller Reboot - Set ONLINE and Velocity Control ON */
|
||||
// send_mess(card, SET_ONLINE, PIE517_axis[signal]);
|
||||
// //send_mess(card, SET_VELCTRL, (char) NULL);
|
||||
// //send_mess(card, SET_VELCTRL, (char*) NULL);
|
||||
// }
|
||||
|
||||
send_mess(card, READ_ONTARGET, PIE517_axis[signal]);
|
||||
@@ -372,7 +372,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -595,15 +595,15 @@ static int motor_init()
|
||||
//{
|
||||
// online = false;
|
||||
// /* Set Controller to ONLINE mode */
|
||||
// send_mess(card_index, SET_ONLINE, (char) NULL);
|
||||
// send_mess(card_index, READ_ONLINE, (char) NULL);
|
||||
// send_mess(card_index, SET_ONLINE, (char*) NULL);
|
||||
// send_mess(card_index, READ_ONLINE, (char*) NULL);
|
||||
// if ((status = recv_mess(card_index, buff, 1)))
|
||||
//online = (atoi(buff)==1) ? true : false;
|
||||
// else
|
||||
//retry++;
|
||||
//} while (online == false && retry < 3);
|
||||
|
||||
//send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
//send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
//status = recv_mess(card_index, buff, 1);
|
||||
|
||||
/* Parse out E517 revision (2 decimal places) and convert to int */
|
||||
@@ -636,7 +636,7 @@ static int motor_init()
|
||||
brdptr->total_axis = total_axis;
|
||||
|
||||
/* Turn ON velocity control mode - All axis */
|
||||
//send_mess(card_index, SET_VELCTRL, (char) NULL);
|
||||
//send_mess(card_index, SET_VELCTRL, (char*) NULL);
|
||||
|
||||
for (motor_index = 0; motor_index < total_axis; motor_index++)
|
||||
{
|
||||
|
||||
@@ -351,7 +351,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ static int motor_init()
|
||||
|
||||
do
|
||||
{
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff[0], 1);
|
||||
|
||||
/* Parse out E710 revision (3 decimal places) and convert to int */
|
||||
|
||||
@@ -252,14 +252,14 @@ static int set_status(int card, int signal)
|
||||
recv_mess(card, buff, FLUSH);
|
||||
|
||||
readOK = false;
|
||||
//send_mess(card, READ_ONLINE, (char) NULL);
|
||||
//send_mess(card, READ_ONLINE, (char*) NULL);
|
||||
/* if (recv_mess(card, buff, 1) && sscanf(buff, "%d", &online_status))
|
||||
{
|
||||
if (!online_status)
|
||||
{
|
||||
*//* Assume Controller Reboot - Set ONLINE and Velocity Control ON */
|
||||
/*send_mess(card, SET_ONLINE, (char) NULL);
|
||||
send_mess(card, SET_VELCTRL, (char) NULL);
|
||||
/*send_mess(card, SET_ONLINE, (char*) NULL);
|
||||
send_mess(card, SET_VELCTRL, (char*) NULL);
|
||||
}
|
||||
*/
|
||||
send_mess(card, READ_ONTARGET, PIE816_axis[signal]);
|
||||
@@ -377,7 +377,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strcpy(buff, nodeptr->postmsgptr);
|
||||
send_mess(card, buff, (char) NULL);
|
||||
send_mess(card, buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
@@ -597,15 +597,15 @@ static int motor_init()
|
||||
online = false;
|
||||
*/
|
||||
/* Set Controller to ONLINE mode */
|
||||
/* send_mess(card_index, SET_ONLINE, (char) NULL);
|
||||
send_mess(card_index, READ_ONLINE, (char) NULL);
|
||||
/* send_mess(card_index, SET_ONLINE, (char*) NULL);
|
||||
send_mess(card_index, READ_ONLINE, (char*) NULL);
|
||||
if ((status = recv_mess(card_index, buff, 1)))
|
||||
online = (atoi(buff)==1) ? true : false;
|
||||
else
|
||||
retry++;
|
||||
} while (online == false && retry < 3);
|
||||
*/
|
||||
send_mess(card_index, GET_IDENT, (char) NULL);
|
||||
send_mess(card_index, GET_IDENT, (char*) NULL);
|
||||
status = recv_mess(card_index, buff, 1);
|
||||
|
||||
/* Parse out E816 revision (2 decimal places) and convert to int */
|
||||
@@ -639,7 +639,7 @@ static int motor_init()
|
||||
brdptr->total_axis = total_axis;
|
||||
|
||||
/* Turn ON velocity control mode - All axis */
|
||||
/*send_mess(card_index, SET_VELCTRL, (char) NULL);*/
|
||||
/*send_mess(card_index, SET_VELCTRL, (char*) NULL);*/
|
||||
|
||||
for (motor_index = 0; motor_index < total_axis; motor_index++)
|
||||
{
|
||||
|
||||
@@ -334,7 +334,7 @@ static int set_status(int card, int signal)
|
||||
nodeptr->postmsgptr != 0)
|
||||
{
|
||||
strncpy(send_buff, nodeptr->postmsgptr, 80);
|
||||
send_mess(card, send_buff, (char) NULL);
|
||||
send_mess(card, send_buff, (char*) NULL);
|
||||
nodeptr->postmsgptr = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user