diff --git a/docs/motorRecord.html b/docs/motorRecord.html
index 4e9255ce8..2a922a85b 100644
--- a/docs/motorRecord.html
+++ b/docs/motorRecord.html
@@ -725,6 +725,13 @@
Soft Channel Device Driver
- The Soft Channel database links (i.e., DINP, RINP and STOO) are only processed
+ The Soft Channel database links (i.e., DINP, MINP, RINP and STOO) are only processed
when the Soft Channel device driver is selected. These links are ignored
when using any other Motor Record device driver.
- The input links (i.e., DINP, RDBL and RINP) are monitored for value changes by a
+ The input links (i.e., DINP, MINP, RDBL and RINP) are monitored for value changes by a
CA event task. Users must choose either a dial input link (RDBL) or a raw
input link (RINP), but not both. At this time, the above links are not
dynamically retargetable.
diff --git a/motorApp/MotorSrc/motorRecord.dbd b/motorApp/MotorSrc/motorRecord.dbd
index be7c549de..82106dc6f 100644
--- a/motorApp/MotorSrc/motorRecord.dbd
+++ b/motorApp/MotorSrc/motorRecord.dbd
@@ -754,6 +754,12 @@ recordtype(motor) {
special(SPC_MOD)
interest(1)
}
+ field(MINP,DBF_INLINK) {
+ prompt("MSTA Input Link")
+ promptgroup(GUI_COMMON)
+ special(SPC_MOD)
+ interest(1)
+ }
field(RINP,DBF_INLINK) {
prompt("RMP Input Link")
promptgroup(GUI_COMMON)
diff --git a/motorApp/SoftMotorSrc/devSoft.cc b/motorApp/SoftMotorSrc/devSoft.cc
index 55d291384..aab385233 100644
--- a/motorApp/SoftMotorSrc/devSoft.cc
+++ b/motorApp/SoftMotorSrc/devSoft.cc
@@ -254,6 +254,23 @@ void soft_dinp_func(struct motorRecord *mr, short newdinp)
}
}
+void soft_minp_func(struct motorRecord *mr, long newminp)
+{
+ msta_field status;
+ unsigned int old_RA_DONE;
+ if (interruptAccept != TRUE)
+ return;
+
+ status.All = mr->msta;
+ old_RA_DONE = status.Bits.RA_DONE;
+ Debug(5, "update(): old msta=0x%04x newminp=0x%04x for %s.\n",
+ mr->msta, (unsigned)newminp, mr->name);
+
+ status.All = newminp;
+ status.Bits.RA_DONE = old_RA_DONE;
+ mr->msta = status.All;
+ soft_process(mr);
+}
void soft_rinp_func(struct motorRecord *mr, long newrinp)
{
diff --git a/motorApp/SoftMotorSrc/devSoft.h b/motorApp/SoftMotorSrc/devSoft.h
index 470091cd2..c000b18b5 100644
--- a/motorApp/SoftMotorSrc/devSoft.h
+++ b/motorApp/SoftMotorSrc/devSoft.h
@@ -57,6 +57,7 @@ struct motor_node {
extern long soft_init(int);
extern long soft_init_record(void *);
extern void soft_dinp_func(struct motorRecord *, short);
+extern void soft_minp_func(struct motorRecord *, long);
extern void soft_rdbl_func(struct motorRecord *, double);
extern void soft_rinp_func(struct motorRecord *, long);
extern void soft_motor_callback(CALLBACK *);
diff --git a/motorApp/SoftMotorSrc/devSoftAux.cc b/motorApp/SoftMotorSrc/devSoftAux.cc
index 05a049622..780d0d470 100644
--- a/motorApp/SoftMotorSrc/devSoftAux.cc
+++ b/motorApp/SoftMotorSrc/devSoftAux.cc
@@ -66,6 +66,7 @@ static inline void Debug(int level, const char *format, ...)
}
STATIC void soft_dinp(struct event_handler_args);
+STATIC void soft_minp(struct event_handler_args);
STATIC void soft_rdbl(struct event_handler_args);
STATIC void soft_rinp(struct event_handler_args);
STATIC EPICSTHREADFUNC soft_motor_task(void *);
@@ -78,6 +79,11 @@ STATIC void soft_dinp(struct event_handler_args args)
soft_dinp_func((struct motorRecord *) args.usr, *((short *) args.dbr));
}
+STATIC void soft_minp(struct event_handler_args args)
+{
+ soft_minp_func((struct motorRecord *) args.usr, *((long *) args.dbr));
+}
+
STATIC void soft_rdbl(struct event_handler_args args)
{
@@ -162,7 +168,7 @@ STATIC EPICSTHREADFUNC soft_motor_task(void *parm)
{
struct motorRecord *mr;
struct motor_node *node;
- chid dinp, rdbl, rinp;
+ chid dinp, minp, rdbl, rinp;
epicsEventId wait_forever;
epicsEventWait(soft_motor_sem); /* Wait for dbLockInitRecords() to execute. */
@@ -195,7 +201,17 @@ STATIC EPICSTHREADFUNC soft_motor_task(void *parm)
{
ptr->default_done_behavior = true;
}
-
+ if (((mr->minp.type == PV_LINK) ||
+ (mr->minp.type == CA_LINK) ||
+ (mr->minp.type == DB_LINK)) &&
+ (mr->minp.value.pv_link.pvname != NULL))
+ {
+ Debug(5, "devSoftAux::soft_motor_task: adding minp link for motor %s link=%s\n", mr->name, mr->minp.value.pv_link.pvname);
+ SEVCHK(ca_search(mr->minp.value.pv_link.pvname, &minp),"ca_search() failure");
+ SEVCHK(ca_add_event(DBR_SHORT, minp, soft_minp, mr, NULL),"ca_add_event() failure");
+ SEVCHK(ca_pend_io((float) 5.0), "MINP link failure");
+ }
+
if ((mr->urip != 0) &&
((mr->rdbl.type == PV_LINK) ||
(mr->rdbl.type == CA_LINK) ||
|