forked from epics_driver_modules/motorBase
Fixed stuck DMOV problem when "setting" position.
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
FILENAME... devSoft.c
|
||||
USAGE... Motor record device level support for Soft channel.
|
||||
|
||||
Version: $Revision: 1.2 $
|
||||
Modified By: $Author: sluiter $
|
||||
Last Modified: $Date: 2000-02-08 22:19:25 $
|
||||
Last Modified: $Date: 2000-03-03 22:35:49 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -116,6 +117,15 @@ STATIC long build(motor_cmnd command, double *parms, struct motorRecord *mr)
|
||||
status = OK;
|
||||
break;
|
||||
|
||||
case LOAD_POS:
|
||||
{
|
||||
struct soft_private *ptr = (struct soft_private *) mr->dpvt;
|
||||
|
||||
mr->msta = RA_DONE;
|
||||
callbackRequest(&ptr->callback);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
status = ERROR;
|
||||
}
|
||||
@@ -183,3 +193,19 @@ STATIC void soft_process(struct motorRecord *mr)
|
||||
dbScanUnlock((struct dbCommon *) mr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
FUNCTION... void soft_motor_callback(CALLBACK *)
|
||||
USAGE... Process motor record after the following events:
|
||||
- LOAD_POS motor command.
|
||||
LOGIC...
|
||||
*/
|
||||
|
||||
void soft_motor_callback(CALLBACK *cbptr)
|
||||
{
|
||||
struct motorRecord *mr;
|
||||
|
||||
callbackGetUser(mr, cbptr);
|
||||
soft_process(mr);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ FILENAME.. devSoft.h
|
||||
USAGE... This file contains information that is common to
|
||||
all Soft channel device support modules.
|
||||
|
||||
Version: $Revision: 1.1 $
|
||||
Version: $Revision: 1.2 $
|
||||
Modified By: $Author: sluiter $
|
||||
Last Modified: $Date: 2000-02-08 22:19:26 $
|
||||
Last Modified: $Date: 2000-03-03 22:36:52 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -37,11 +37,13 @@ extern long soft_init_record(struct motorRecord *);
|
||||
extern void soft_dinp_func(struct motorRecord *, short);
|
||||
extern void soft_rdbl_func(struct motorRecord *, double);
|
||||
extern void soft_rinp_func(struct motorRecord *, long);
|
||||
extern void soft_motor_callback(CALLBACK *);
|
||||
|
||||
#define MAXMSGS 20
|
||||
|
||||
struct soft_private
|
||||
{
|
||||
CALLBACK callback;
|
||||
long callback_flag;
|
||||
short dinp_value; /* Value from DINP link. */
|
||||
BOOLEAN default_done_behavior; /* If the DINP is not programmed, exhibit
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
FILENAME... devSoftAux.c
|
||||
USAGE... Motor record device level support for Soft channel.
|
||||
|
||||
Version: $Revision: 1.1 $
|
||||
Version: $Revision: 1.2 $
|
||||
Modified By: $Author: sluiter $
|
||||
Last Modified: $Date: 2000-02-08 22:19:26 $
|
||||
Last Modified: $Date: 2000-03-03 22:36:31 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -89,6 +89,7 @@ long soft_init(int after)
|
||||
long soft_init_record(struct motorRecord *mr)
|
||||
{
|
||||
struct soft_private *ptr;
|
||||
CALLBACK *cbptr;
|
||||
STATUS status;
|
||||
static int count = 0;
|
||||
|
||||
@@ -102,6 +103,11 @@ long soft_init_record(struct motorRecord *mr)
|
||||
ptr = (struct soft_private *) mr->dpvt;
|
||||
ptr->dinp_value = mr->dmov; /* Must match after initialzation. */
|
||||
|
||||
cbptr = &ptr->callback;
|
||||
callbackSetCallback((void (*)(struct callbackPvt *)) soft_motor_callback,
|
||||
cbptr);
|
||||
callbackSetPriority(priorityMedium, cbptr);
|
||||
callbackSetUser(mr, cbptr);
|
||||
return ((long) status);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user