diff --git a/db/sinqMotor.db b/db/sinqMotor.db index 257297c..96aa4f0 100755 --- a/db/sinqMotor.db +++ b/db/sinqMotor.db @@ -41,6 +41,16 @@ record(motor,"$(INSTR)$(M)") field(RMOD,"3") # Retry mode 3 ("In-Position"): This suppresses any retries from the motor record. } +# This record holds a copy of the motor record target position field (.VAL) and allows to access +# the value from within the driver via the index motorTargetPosition_. +# This record is coupled to the parameter library via motorTargetPosition_ -> MOTOR_TARGET_POSITION. +record(ao,"$(INSTR)$(M):TargetPosition") { + field(DOL, "$(INSTR)$(M).VAL CP MS") + field(OMSL, "closed_loop") + field(DTYP, "asynFloat64") + field(OUT, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_TARGET_POSITION") +} + # This PV allows force-stopping the motor record from within the driver by setting # the motorForceStop_ value in the parameter library to 1. It should be reset to 0 by the driver afterwards. # The implementation strategy is taken from https://epics.anl.gov/tech-talk/2022/msg00464.php. diff --git a/src/sinqController.h b/src/sinqController.h index 962426e..265996e 100644 --- a/src/sinqController.h +++ b/src/sinqController.h @@ -235,6 +235,7 @@ class epicsShareClass sinqController : public asynMotorController { #define FIRST_SINQMOTOR_PARAM motorMessageText_ int motorMessageText_; + int motorTargetPosition_; int motorEnable_; int motorEnableRBV_; int motorCanDisable_;