diff --git a/.ci b/.ci index 20f8e0539..576460163 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit 20f8e053931fdef8a9413cc6229286c5d9ed152f +Subproject commit 576460163031255c09948566dd2f2409d86ab8d4 diff --git a/.gitattributes b/.gitattributes index 9712a0991..35b94aa8c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,27 @@ -#Which files need CRLF handling +# Set the default behavior, in case people don't have core.autocrlf set. * text=auto -*.sh eol=lf -*.bat eol=crlf -*.cmd -text + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.c text +*.cpp text +*.h text +*.hpp text +*.java text +*.sh text eol=lf +*.bat text +*.cmd text +*.db text +*.dbd text +*.template text +*.substitutions text + +# Declare files that will always have CRLF line endings on checkout. +*.sln text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.class binary +*.vi binary + diff --git a/.gitignore b/.gitignore index 2d9ca64e9..515a5b304 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *~ -O.* +O.*/ *.swp *BAK.adl bin/ @@ -12,7 +12,12 @@ lib/ templates/ cdCommands envPaths -dllPath.bat +dllPath*.bat +runIOC.bat +runIOC.sh +relPaths.sh +iocBoot/iocmotorSim/motor.substitutions.local +.project auto_settings.sav* auto_positions.sav* .ccfxprepdir/ diff --git a/.gitmodules b/.gitmodules index d4ff47101..26d7a3326 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "modules/motorNewport"] path = modules/motorNewport - url = https://github.com/epics-motor/motorNewport.git + url = https://github.com/ISISComputingGroup/motorNewport.git + branch = ibex [submodule "modules/motorOms"] path = modules/motorOms url = https://github.com/epics-motor/motorOms.git @@ -24,7 +25,8 @@ url = https://github.com/epics-motor/motorKohzu.git [submodule "modules/motorMclennan"] path = modules/motorMclennan - url = https://github.com/epics-motor/motorMclennan.git + url = https://github.com/ISISComputingGroup/motorMclennan.git + branch = ibex [submodule "modules/motorMicroMo"] path = modules/motorMicroMo url = https://github.com/epics-motor/motorMicroMo.git @@ -84,16 +86,20 @@ url = https://github.com/epics-motor/motorSmarAct.git [submodule "modules/motorMotorSim"] path = modules/motorMotorSim - url = https://github.com/epics-motor/motorMotorSim.git + url = https://github.com/ISISComputingGroup/motorMotorSim.git + branch = ibex [submodule "modules/motorMXmotor"] path = modules/motorMXmotor url = https://github.com/epics-motor/motorMXmotor.git [submodule "modules/motorParker"] path = modules/motorParker url = https://github.com/epics-motor/motorParker.git -[submodule ".ci"] - path = .ci - url = https://github.com/epics-base/ci-scripts [submodule "modules/motorAcsMotion"] path = modules/motorAcsMotion url = https://github.com/epics-motor/motorAcsMotion.git +[submodule ".ci"] + path = .ci + url = https://github.com/epics-base/ci-scripts +[submodule "modules/motorLinMot"] + path = modules/motorLinMot + url = https://github.com/ISISComputingGroup/motorLinMot.git diff --git a/configure/RELEASE b/configure/RELEASE index 3fdf37936..f79c2a97f 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -47,3 +47,18 @@ IPAC=$(SUPPORT)/ipac-R2-15 -include $(TOP)/../RELEASE.local -include $(TOP)/../RELEASE.$(EPICS_HOST_ARCH).local -include $(TOP)/configure/RELEASE.local + +ASYN=$(SUPPORT)/asyn/master +AUTOSAVE=$(SUPPORT)/autosave/master +BUSY=$(SUPPORT)/busy/master +CALC=$(SUPPORT)/calc/master +IPAC=$(SUPPORT)/ipac/master +SNCSEQ=$(SUPPORT)/seq/master +SSCAN=$(SUPPORT)/sscan/master +ONCRPC=$(SUPPORT)/oncrpc/master +LUA=$(SUPPORT)/lua/master +# optional extra local definitions here +-include $(TOP)/configure/RELEASE.private + +include $(TOP)/../../../ISIS_CONFIG +-include $(TOP)/../../../ISIS_CONFIG.$(EPICS_HOST_ARCH) diff --git a/modules/Makefile b/modules/Makefile index 13b5cdc51..d12467910 100644 --- a/modules/Makefile +++ b/modules/Makefile @@ -7,8 +7,8 @@ SUBMODULES += motorOms SUBMODULES += motorNewport SUBMODULES += motorAMCI SUBMODULES += motorAcs -SUBMODULES += motorAcsMotion -SUBMODULES += motorAcsTech80 +#SUBMODULES += motorAcsMotion +#SUBMODULES += motorAcsTech80 SUBMODULES += motorAerotech SUBMODULES += motorAttocube SUBMODULES += motorDeltaTau @@ -19,7 +19,7 @@ endif SUBMODULES += motorIms SUBMODULES += motorKohzu SUBMODULES += motorMclennan -SUBMODULES += motorMicos +#SUBMODULES += motorMicos SUBMODULES += motorMicroMo SUBMODULES += motorMicronix SUBMODULES += motorMotorSim @@ -38,10 +38,13 @@ SUBMODULES += motorPIGCS2 ifdef LUA SUBMODULES += motorScriptMotor endif -SUBMODULES += motorSmarAct +#SUBMODULES += motorSmarAct SUBMODULES += motorSmartMotor SUBMODULES += motorThorLabs +## isis facility extras +SUBMODULES += motorLinMot + # Allow sites to add extra submodules -include Makefile.local @@ -73,6 +76,14 @@ ifdef BUSY $(ECHO) Creating $@, BUSY = $(BUSY) @echo BUSY = $(BUSY)>> $@ endif +ifdef CALC + $(ECHO) Creating $@, CALC = $(CALC) + @echo CALC = $(CALC)>> $@ +endif +ifdef SSCAN + $(ECHO) Creating $@, SSCAN = $(SSCAN) + @echo SSCAN = $(SSCAN)>> $@ +endif ifdef IPAC $(ECHO) Creating $@, IPAC = $(IPAC) @echo IPAC = $(IPAC)>> $@ diff --git a/modules/motorAcsMotion b/modules/motorAcsMotion index ee68ab79d..91e8e1eb8 160000 --- a/modules/motorAcsMotion +++ b/modules/motorAcsMotion @@ -1 +1 @@ -Subproject commit ee68ab79daf075215312ad851a84f5f18697ce77 +Subproject commit 91e8e1eb8d7e468f5628482a9e18e891c5960d9f diff --git a/modules/motorLinMot b/modules/motorLinMot new file mode 160000 index 000000000..85308e394 --- /dev/null +++ b/modules/motorLinMot @@ -0,0 +1 @@ +Subproject commit 85308e394d0e9b57a963290cad578c5df74f8612 diff --git a/modules/motorMclennan b/modules/motorMclennan index dab26dc0d..2ad6227ad 160000 --- a/modules/motorMclennan +++ b/modules/motorMclennan @@ -1 +1 @@ -Subproject commit dab26dc0d0bf709ca4b9d8c8aed73fdbfd75e500 +Subproject commit 2ad6227ad6efb2b36749e8f7e6e2b0cba0b35b08 diff --git a/modules/motorMotorSim b/modules/motorMotorSim index cdea87404..229fb86c3 160000 --- a/modules/motorMotorSim +++ b/modules/motorMotorSim @@ -1 +1 @@ -Subproject commit cdea87404306161a0f9edf5cd6efd2410612b6f7 +Subproject commit 229fb86c34318cd6d01d40fec7443f047c0695a8 diff --git a/modules/motorNewport b/modules/motorNewport index d84cfe2bf..06511fdff 160000 --- a/modules/motorNewport +++ b/modules/motorNewport @@ -1 +1 @@ -Subproject commit d84cfe2bf5247475cebd8ce609c219e854c72742 +Subproject commit 06511fdff43db058e53874430af161728515ff97 diff --git a/modules/motorSM300 b/modules/motorSM300 new file mode 160000 index 000000000..92baa9153 --- /dev/null +++ b/modules/motorSM300 @@ -0,0 +1 @@ +Subproject commit 92baa91539c95f01295aac5ee73f9c03a96e5c41 diff --git a/motorApp/Db/SoftMotorEx.db b/motorApp/Db/SoftMotorEx.db index ff015bb14..aa10d82fe 100644 --- a/motorApp/Db/SoftMotorEx.db +++ b/motorApp/Db/SoftMotorEx.db @@ -30,7 +30,7 @@ record(motor, "$(user):linear") { field(OUT, "#C0 S0 @") field(MRES, "0.001") field(PREC, "3") - field(EGU, "mm.") + field(EGU, "mm") field(DHLM, "1000") field(DLLM, "-1000") field(RTRY, "0") @@ -46,7 +46,7 @@ record(motor, "$(user):rotary") { field(RRES, "1.0") field(URIP, "Yes") field(PREC, "3") - field(EGU, "deg.") + field(EGU, "degree") field(DHLM, "45") field(DLLM, "-45") field(RTRY, "0") diff --git a/motorApp/Db/asyn_motor.db b/motorApp/Db/asyn_motor.db index fefe379f2..82ebcd424 100644 --- a/motorApp/Db/asyn_motor.db +++ b/motorApp/Db/asyn_motor.db @@ -22,17 +22,25 @@ record(motor, "$(P)$(M)") { field(DLLM, "$(DLLM)") field(INIT, "$(INIT)") field(RTRY, "$(RTRY=10)") - field(RSTM, "$(RSTM=NearZero)") + field(RSTM, "$(RSTM=Never)") field(TWV, "1") field(SDIS, "$(P)$(M)_able.VAL") + # ISIS local archiving and alarm + info(archive, "0.02 VAL RBV DVAL OFF MSTA DIR CNEN MOVN DMOV MISS RCNT") + info(alarm, "Motors") } +# ISIS local aliases for genie_python +alias("$(P)$(M)", "$(P)$(M):SP") +alias("$(P)$(M)", "$(P)$(M):SP:RBV") + record(bo, "$(P)$(M)_able") { field(DESC, "motor enable") field(PINI, "YES") field(OUT, "$(P)$(M).DISP") field(ZNAM, "Enable") field(ONAM, "Disable") + field(UDFS, "NO_ALARM") } record(calcout, "$(P)$(M)_vCh") { @@ -88,6 +96,20 @@ record(ao,"$(P)$(M)Resolution") { field(PREC, "$(PREC)") } +# allow splitting out of MSTA +record(mbbiDirect, "$(P)$(M):_MSTABITS") +{ + field(INP, "$(P)$(M).MSTA CP") +} + +record(bi, "$(P)$(M)_HOMED") +{ + field(DESC, "Motor Homed") + field(ZNAM, "No") + field(ONAM, "Yes") + field(INP, "$(P)$(M):_MSTABITS.BE CP") +} + #! Further lines contain data used by VisualDCT #! View(405,484,0.9) #! Record("$(P)$(M)",840,675,0,0,"$(P)$(M)") diff --git a/motorApp/Db/asyn_motor_model2.db b/motorApp/Db/asyn_motor_model2.db index 3fa391a54..4a2deb05d 100644 --- a/motorApp/Db/asyn_motor_model2.db +++ b/motorApp/Db/asyn_motor_model2.db @@ -22,7 +22,7 @@ record(motor, "$(P)$(M)") { field(DLLM, "$(DLLM)") field(INIT, "$(INIT)") field(RTRY, "$(RTRY=10)") - field(RSTM, "$(RSTM=NearZero)") + field(RSTM, "$(RSTM=Never)") field(TWV, "1") field(SDIS, "$(P)$(M)_able.VAL") } @@ -33,6 +33,7 @@ record(bo, "$(P)$(M)_able") { field(OUT, "$(P)$(M).DISP") field(ZNAM, "Enable") field(ONAM, "Disable") + field(UDFS, "NO_ALARM") } record(calcout, "$(P)$(M)_vCh") { diff --git a/motorApp/Db/asyn_motor_positions.req b/motorApp/Db/asyn_motor_positions.req index 2d8666bb3..731a90302 100644 --- a/motorApp/Db/asyn_motor_positions.req +++ b/motorApp/Db/asyn_motor_positions.req @@ -1,2 +1,2 @@ # FILE... motor_positions.req -$(P)$(M).DVAL +#$(P)$(M).DVAL diff --git a/motorApp/Db/basic_asyn_motor.db b/motorApp/Db/basic_asyn_motor.db index b678741b0..8434f6a44 100644 --- a/motorApp/Db/basic_asyn_motor.db +++ b/motorApp/Db/basic_asyn_motor.db @@ -17,9 +17,18 @@ record(motor,"$(P)$(M)") field(DHLM,"$(DHLM)") field(DLLM,"$(DLLM)") field(INIT,"$(INIT)") + field(RTRY,"$(RTRY=10)") + field(RSTM,"$(RSTM=Never)") field(TWV,"1") + # ISIS local archiving and alarm + info(archive, "0.02 VAL RBV DVAL OFF MSTA DIR CNEN MOVN DMOV MISS RCNT") + info(alarm, "Motors") } +# ISIS local aliases for genie_python +alias("$(P)$(M)", "$(P)$(M):SP") +alias("$(P)$(M)", "$(P)$(M):SP:RBV") + # These records make the motor resolution, offset and direction available to the driver # which is needed for profile moves and other applications @@ -54,3 +63,49 @@ record(ao,"$(P)$(M)Resolution") { field(PREC, "$(PREC)") } +# ISIS enable/disable +record(bo, "$(P)$(M)_able") { + field(DESC, "motor enable") + field(PINI, "YES") + field(OUT, "$(P)$(M).DISP") + field(ZNAM, "Enable") + field(ONAM, "Disable") + field(UDFS, "NO_ALARM") +} + +record(ao,"$(P)$(M)_MRESMON") +{ + field(OMSL, "closed_loop") + field(DOL, "$(P)$(M).MRES CP") + field(DTYP, "asynFloat64") + field(OUT, "@asyn($(PORT),$(ADDR))MOTOR_RESOLUTION") +} + +record(calcout,"$(P)$(M)_MERATMON") +{ + field(INPA, "$(P)$(M).MRES CP") + field(INPB, "$(P)$(M).ERES CP") + field(CALC, "(A != 0 && B != 0) ? A / B : 0") + field(OOPT, "When Non-zero") + field(OUT, "$(P)$(M)_MERAT PP") +} + +record(ao,"$(P)$(M)_MERAT") +{ + field(DTYP, "asynFloat64") + field(OUT, "@asyn($(PORT),$(ADDR))MOTOR_ENCODER_RATIO") +} + +# allow splitting out of MSTA +record(mbbiDirect, "$(P)$(M):_MSTABITS") +{ + field(INP, "$(P)$(M).MSTA CP") +} + +record(bi, "$(P)$(M)_HOMED") +{ + field(DESC, "Motor Homed") + field(ZNAM, "No") + field(ONAM, "Yes") + field(INP, "$(P)$(M):_MSTABITS.BE CP") +} diff --git a/motorApp/Db/basic_asyn_motor_model2.db b/motorApp/Db/basic_asyn_motor_model2.db index 84e7c1fea..58fd808b1 100644 --- a/motorApp/Db/basic_asyn_motor_model2.db +++ b/motorApp/Db/basic_asyn_motor_model2.db @@ -18,4 +18,5 @@ record(motor,"$(P)$(M)") field(DLLM,"$(DLLM)") field(INIT,"$(INIT)") field(TWV,"1") + field(RSTM,"$(RSTM=Never)") } diff --git a/motorApp/Db/basic_motor.db b/motorApp/Db/basic_motor.db index 87c70beaf..e542840e5 100644 --- a/motorApp/Db/basic_motor.db +++ b/motorApp/Db/basic_motor.db @@ -17,6 +17,27 @@ grecord(motor,"$(P)$(M)") field(DHLM,"$(DHLM)") field(DLLM,"$(DLLM)") field(INIT,"$(INIT)") + field(RSTM,"$(RSTM=Never)") field(TWV,"1") + # ISIS local archiving and alarm + info(archive, "0.02 VAL RBV DVAL OFF MSTA DIR CNEN MOVN DMOV MISS RCNT") + info(alarm, "Motors") } +# allow splitting out of MSTA +record(mbbiDirect, "$(P)$(M):_MSTABITS") +{ + field(INP, "$(P)$(M).MSTA CP") +} + +record(bi, "$(P)$(M)_HOMED") +{ + field(DESC, "Motor Homed") + field(ZNAM, "No") + field(ONAM, "Yes") + field(INP, "$(P)$(M):_MSTABITS.BE CP") +} + +# ISIS local aliases for genie_python +alias("$(P)$(M)", "$(P)$(M):SP") +alias("$(P)$(M)", "$(P)$(M):SP:RBV") diff --git a/motorApp/Db/basic_motor_settings.req b/motorApp/Db/basic_motor_settings.req index 9072214a8..7dcfeb06a 100644 --- a/motorApp/Db/basic_motor_settings.req +++ b/motorApp/Db/basic_motor_settings.req @@ -45,4 +45,7 @@ $(P)$(M).PREM $(P)$(M).POST $(P)$(M).FLNK $(P)$(M).RMOD +$(P)$(M).ADEL +$(P)$(M).MDEL +$(P)$(M).SPMG $(P)$(M).RSTM diff --git a/motorApp/Db/linmot_extra.db b/motorApp/Db/linmot_extra.db new file mode 100644 index 000000000..a8331a79e --- /dev/null +++ b/motorApp/Db/linmot_extra.db @@ -0,0 +1,3 @@ +record(motor, "$(P)$(M)") { + field(OFF, "$(OFF)") +} diff --git a/motorApp/Db/motor.db b/motorApp/Db/motor.db index 7b5b4712b..76ed0740a 100644 --- a/motorApp/Db/motor.db +++ b/motorApp/Db/motor.db @@ -14,24 +14,34 @@ record(motor, "$(P)$(M)") { field(BDST, "$(BDST)") field(BVEL, "$(BVEL)") field(BACC, "$(BACC)") - field(OUT, "#C$(C) S$(S) @") + field(OUT, "#C$(C) S$(S) @$(MOTORSIM=)") field(MRES, "$(MRES)") + field(ERES, "$(ERES=)") + field(UEIP, "$(UEIP=0)") field(PREC, "$(PREC)") field(EGU, "$(EGU)") field(DHLM, "$(DHLM)") field(DLLM, "$(DLLM)") field(INIT, "$(INIT)") - field(RSTM, "$(RSTM=NearZero)") + field(RSTM, "$(RSTM=Never)") field(TWV, "1") field(SDIS, "$(P)$(M)_able.VAL") + # ISIS local archiving and alarm + info(archive, "0.02 VAL RBV DVAL OFF MSTA DIR CNEN MOVN DMOV MISS RCNT") + info(alarm, "Motors") } +# ISIS local aliases for genie_python +alias("$(P)$(M)", "$(P)$(M):SP") +alias("$(P)$(M)", "$(P)$(M):SP:RBV") + record(bo, "$(P)$(M)_able") { field(DESC, "motor enable") field(PINI, "YES") field(OUT, "$(P)$(M).DISP") field(ZNAM, "Enable") field(ONAM, "Disable") + field(UDFS, "NO_ALARM") } record(calcout, "$(P)$(M)_vCh") { @@ -53,6 +63,20 @@ record(calcout, "$(P)$(M)_twCh") { field(OUT, "$(P)$(M).TWV") } +# allow splitting out of MSTA +record(mbbiDirect, "$(P)$(M):_MSTABITS") +{ + field(INP, "$(P)$(M).MSTA CP") +} + +record(bi, "$(P)$(M)_HOMED") +{ + field(DESC, "Motor Homed") + field(ZNAM, "No") + field(ONAM, "Yes") + field(INP, "$(P)$(M):_MSTABITS.BE CP") +} + #! Further lines contain data used by VisualDCT #! View(405,680,1.0) #! Record("$(P)$(M)",840,674,0,0,"$(P)$(M)") diff --git a/motorApp/Db/motorController.db b/motorApp/Db/motorController.db new file mode 100644 index 000000000..cfca138eb --- /dev/null +++ b/motorApp/Db/motorController.db @@ -0,0 +1,7 @@ +## pvs that should be available per controller +## Q is normally MOT:MTRxx: + +record(longin, "$(P)$(Q)AXES_NUM") { + field(DESC, "number of axes on controller") + field(VAL, "$(AXES_NUM=8)") +} diff --git a/motorApp/Db/motorStatus.db b/motorApp/Db/motorStatus.db new file mode 100644 index 000000000..d1bb4e456 --- /dev/null +++ b/motorApp/Db/motorStatus.db @@ -0,0 +1,95 @@ +# monitor the motor status and update a string field with results +record(aSub, "$(P)$(M):_MSTACALC") +{ + field(SNAM, "displayMotorMSTA") + field(INPA, "$(P)$(M).MSTA CP") + field(FTA, "ULONG") + field(OUTA, "$(P)$(M)_MSTA_STR PP") + field(FTVA, "CHAR") + field(NOVA, "512") +} + +record(waveform, "$(P)$(M)_MSTA_STR") +{ + field(NELM, "512") + field(FTVL, "CHAR") + field(DESC, "Text version of motor MSTA") +} + +record(aSub, "$(P)$(M):_STATUSCALC") +{ + field(SNAM, "displayMotorMSTASimple") + field(INPA, "$(P)$(M).MSTA CP") + field(FTA, "ULONG") + field(OUTA, "$(P)$(M)_STATUS PP") + field(FTVA, "STRING") + field(NOVA, "1") +} + +record(stringin, "$(P)$(M)_STATUS") +{ + field(DESC, "Simple Text version of motor MSTA") +} + +# Expose the DMOV field as a PV record, so it can be accessed from a block +record(ai, "$(P)$(M):DMOV") +{ + field(DESC, "Done moving?") + field(SCAN, "Passive") + field(DTYP, "Soft Channel") + field(INP, "$(P)$(M).DMOV CP") +} + +record(stringin, "$(P)$(M)_IOCNAME"){ + field(DESC, "IOC name eg GALIL_01") + field(VAL, "$(IOCNAME=UNKNOWN)") +} + + +# Fallback tolerance used if neither retry deadband not setpoint deadband is set. +record(calc, "$(P)$(M):IN_POSITION:_FALLBACK") { + field(ASG, "READONLY") + field(INPA, "$(P)$(M).ERES CP MS") + field(INPB, "$(P)$(M).MRES CP MS") + field(CALC, "10*MAX(ABS(A),ABS(B))") +} + +record(calc, "$(P)$(M):IN_POSITION:TOLERANCE") { + field(ASG, "READONLY") + field(INPA, "$(P)$(M).RTRY CP MS") # Max retries + field(INPB, "$(P)$(M).RDBD CP MS") # Retry deadbands + field(INPC, "$(P)$(M).SPDB CP MS") # Setpoint deadband + field(INPD, "$(P)$(M).MRES CP MS") # motor resolution + field(INPE, "$(P)$(M):IN_POSITION:_FALLBACK CP MS") # fallback tolerance + + # If retry deadband > MRES or max retries > 0, use retry deadband + # Otherwise, if setpoint deadband is non-zero use it, else fall back to 10*MAX(ERES, MRES) + field(CALC, "(A>0||B>D)?B:((C>0)?C:E)") +} + +record(calc, "$(P)$(M):DIFF_WITHIN_TOL") { + field(ASG, "READONLY") + field(INPA, "$(P)$(M):IN_POSITION:TOLERANCE CP MS") + field(INPB, "$(P)$(M).DIFF CP MS") + + # If moving assume in position, otherwise check that + field(CALC, "ABS(B)<=ABS(A)") +} + +record(calc, "$(P)$(M):IN_POSITION") { + field(ASG, "READONLY") + field(INPA, "$(P)$(M):DIFF_WITHIN_TOL CP MS") + field(INPB, "$(P)$(M).MOVN CP MS") + + # If moving assume in position, otherwise check that + field(CALC, "B||A") +} + +record(calc, "$(P)$(M):USING_ENCODER") { + field(ASG, "READONLY") + field(INPA, "$(P)$(M).MSTA CP MS") + field(INPB, "$(P)$(M).UEIP CP MS") + + # Bitwise AND on MSTA to select the "encoder present" flag. + field(CALC, "((A&256)=256)&&B") +} diff --git a/motorApp/Db/motorUtil.db b/motorApp/Db/motorUtil.db index ef5a7d5a0..468abf5a5 100644 --- a/motorApp/Db/motorUtil.db +++ b/motorApp/Db/motorUtil.db @@ -11,15 +11,92 @@ record(bo, "$(P)allstop") { field(DESC, "Stop All IOC motors.") } + +# Monitors the global STOP:ALL PV. When this PV changes, '1' is +# sent to $(P)allstop over channel access. +record(calcout, "$(P)allstop:MONITOR") { + field(DESC, "Stop All IOC motors.") + field(INPA, "$(PVPREFIX)CS:MOT:STOP:ALL CP") + field(OOPT, "When Non-zero") + field(CALC, "A") + field(DOPT, "Use OCAL") + field(OCAL, 1) + field(OUT, "$(P)allstop.VAL CA") +} + # Indicates if all motors in this IOC are done moving. # Set by motorUtil when $(P)moving.VAL == 0. record(bi, "$(P)alldone") { field(ZNAM, "moving") field(ONAM, "done") - field(INP, "1") + field(VAL, "1") field(DESC, "All IOC motors done moving.") } +# process "Every Time" so value can be re-applied by periodic processing by _FAN2 +record(calcout, "$(P)_MOVING") +{ + field(SCAN, "Passive") + field(INPA, "$(P)alldone CP") + field(CALC, "A") + field(VAL, "1") + field(OOPT, "Every Time") + field(DOPT, "Use OCAL") + field(OCAL, "A = 0 ? 1 : 0") + field(OUT, "$(P)_FAN PP") +} + +## this file get loaded by each motor IOC, it needs to +## set a different calc field in MOVING for each IOC +## +## it is OK to reuse OUTA in the lines when they refer to a +## specific IOC and no two lines will get loaded at one. However +## it is IMPORTANT to not re-use one of the outputs on the +## MOVING or _MOVING1 etc calc record target +## don't write to the L fields of MOVING, _MOVING1 and _MOVING2 +## as this is written to already - see INSTETC.db +record(dfanout, "$(P)_FAN") +{ + field(OMSL, "supervisory") + field(SELM, "All") +$(IFIOC_GALIL_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.A CA") +$(IFIOC_GALIL_02=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.B CA") +$(IFIOC_GALIL_03=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.C CA") +$(IFIOC_GALIL_04=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.D CA") +$(IFIOC_GALIL_05=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.E CA") +$(IFIOC_GALIL_06=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.F CA") +$(IFIOC_GALIL_07=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.G CA") +$(IFIOC_GALIL_08=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.H CA") +$(IFIOC_GALIL_09=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.I CA") +$(IFIOC_GALIL_10=#) field(OUTA, "$(PVPREFIX)CS:MOT:MOVING.J CA") +$(IFIOC_SMC100_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.A CA") +$(IFIOC_CONEXAGP_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.B CA") +$(IFIOC_MCLEN_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.C CA") +$(IFIOC_MCLEN_02=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.D CA") +$(IFIOC_MCLEN_03=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.E CA") +$(IFIOC_LINMOT_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.F CA") +$(IFIOC_LINMOT_02=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.G CA") +$(IFIOC_LINMOT_03=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.H CA") +$(IFIOC_PIMOT_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.J CA") +$(IFIOC_HUBER_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING1.K CA") +## _MOVING2.A is used by reflectometry ioc +$(IFIOC_NWPRTXPS_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING2.B CA") +$(IFIOC_TC_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING2.C CA") +$(IFIOC_GALILMUL_01=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING2.D CA") +$(IFIOC_GALILMUL_02=#) field(OUTA, "$(PVPREFIX)CS:MOT:_MOVING2.E CA") +} + +# force periodic processing to catch up any missing, shouldn't +# be necessary but no harm to be careful +record(fanout, "$(P)_FAN2") +{ + field(SCAN, "10 second") + field(SELM, "All") + field(LNK1, "$(P)_MOVING.PROC") + field(SDIS, "$(P)_MOVING.PACT") + field(DISV, 1) +} + # The number of motors moving in this IOC. # $(P)moving.VAL is set by motorUtil. record(longout, "$(P)moving") { @@ -27,12 +104,12 @@ record(longout, "$(P)moving") { } # Used by xxx.adl to blink "Moving" indicator. -record(calc, "$(P)alldoneBlink") { - field(SCAN, ".5 second") - field(CALC, "A?0:!B") - field(INPA, "$(P)alldone") - field(INPB, "$(P)alldoneBlink") -} +#record(calc, "$(P)alldoneBlink") { +# field(SCAN, ".5 second") +# field(CALC, "A?0:!B") +# field(INPA, "$(P)alldone") +# field(INPB, "$(P)alldoneBlink") +#} # Allow smart clients to maintain a list of moving motors record(waveform, "$(P)movingDiff") { diff --git a/motorApp/Db/motor_init_extra.db b/motorApp/Db/motor_init_extra.db new file mode 100644 index 000000000..8a11766ae --- /dev/null +++ b/motorApp/Db/motor_init_extra.db @@ -0,0 +1,15 @@ +# If more fields need exposing to macros please update +# all substitution files which call this db file. +# +# Some IOCs using this file: +# LINMOT +# MCLEN +# +# Find all by running "grep -rl 'motor_init_extra.db'" from git bash in top level EPICS +# Ignore results which say 'Device or resource busy' +# + +record(motor, "$(P)$(M)") { + field(OFF, "$(OFF)") + field(JVEL, "$(JVEL)") +} diff --git a/motorApp/Db/motor_positions.req b/motorApp/Db/motor_positions.req index 2d8666bb3..731a90302 100644 --- a/motorApp/Db/motor_positions.req +++ b/motorApp/Db/motor_positions.req @@ -1,2 +1,2 @@ # FILE... motor_positions.req -$(P)$(M).DVAL +#$(P)$(M).DVAL diff --git a/motorApp/Db/periodic_polling.db b/motorApp/Db/periodic_polling.db new file mode 100644 index 000000000..87f538eba --- /dev/null +++ b/motorApp/Db/periodic_polling.db @@ -0,0 +1,25 @@ +record(bo, "$(P)$(M):SAFE_STUP") { + field(FLNK, "$(P)$(M):_SAFE_STUP.PROC") +} + +record(calcout, "$(P)$(M):_SAFE_STUP") { + field(DTYP, "Soft Channel") + field(DESC, "Force Poll of motor position") + field(INPA, "$(P)$(M).MOVN") + field(INPB, "$(P)$(M).DMOV") + field(INPC, "$(P)$(M).HOMF") + field(INPD, "$(P)$(M).HOMR") + field(INPE, "$(P)$(M).JOGF") + field(INPF, "$(P)$(M).JOGR") + field(CALC, "(A=0)&&(B=1)&&(C=0)&&(D=0)&&(E=0)&&(F=0)") + field(OOPT, "When Non-zero") + field(OUT, "$(P)$(M).STUP PP") +} + +record(ao, "$(P)$(M):SCAN") { + field(DTYP, "Soft Channel") + field(DESC, "Every POLL_RATE calls SAFE_STUP") + field(SCAN, "$(POLL_RATE=10) second") + field(FLNK, "$(P)$(M):SAFE_STUP.PROC") +} + diff --git a/motorApp/Db/pseudoMotor.db b/motorApp/Db/pseudoMotor.db index ad6bda90f..3bced055f 100644 --- a/motorApp/Db/pseudoMotor.db +++ b/motorApp/Db/pseudoMotor.db @@ -5,6 +5,7 @@ grecord(bo,"$(P)$(M)_able") field(OUT,"$(P)$(M)_ableput.A PP MS") field(ZNAM,"Enable") field(ONAM,"Disable") + field(UDFS, "NO_ALARM") } grecord(motor,"$(P)$(M)") { @@ -37,6 +38,25 @@ grecord(motor,"$(P)$(M)") field(FOFF,"Frozen") field(NTM,"NO") } + +# ISIS local aliases for genie_python +alias("$(P)$(M)", "$(P)$(M):SP") +alias("$(P)$(M)", "$(P)$(M):SP:RBV") + +# allow splitting out of MSTA +record(mbbiDirect, "$(P)$(M):_MSTABITS") +{ + field(INP, "$(P)$(M).MSTA CP") +} + +record(bi, "$(P)$(M)_HOMED") +{ + field(DESC, "Motor Homed") + field(ZNAM, "No") + field(ONAM, "Yes") + field(INP, "$(P)$(M):_MSTABITS.BE CP") +} + grecord(transform,"$(P)$(M)_ableput") { field(CLCB,"a") diff --git a/motorApp/Db/stopping_motor.db b/motorApp/Db/stopping_motor.db new file mode 100644 index 000000000..675962c55 --- /dev/null +++ b/motorApp/Db/stopping_motor.db @@ -0,0 +1,31 @@ +record(swait, "$(P)$(M):ALLSTOP") +{ + field(SCAN, "1 second") + field(INAN, "$(AS)") + field(INAP, "Yes") + field(CALC, "A") + field(OUTN, "$(P)$(M).STOP") + field(DOPT, "Use VAL") + field(OOPT, "On Change") +} +record(motor,"$(P)$(M)") +{ + field(DESC,"$(DESC)") + field(DTYP,"$(DTYP)") + field(DIR,"$(DIR)") + field(VELO,"$(VELO)") + field(VBAS,"$(VBAS)") + field(ACCL,"$(ACCL)") + field(BDST,"$(BDST)") + field(BVEL,"$(BVEL)") + field(BACC,"$(BACC)") + field(OUT,"@asyn($(PORT),$(ADDR))") + field(MRES,"$(MRES)") + field(PREC,"$(PREC)") + field(EGU,"$(EGU)") + field(DHLM,"$(DHLM)") + field(DLLM,"$(DLLM)") + field(INIT,"$(INIT)") + field(TWV,"1") +} + diff --git a/motorApp/MotorSrc/asynMotorAxis.cpp b/motorApp/MotorSrc/asynMotorAxis.cpp index eb61b5bc2..ca7076c33 100644 --- a/motorApp/MotorSrc/asynMotorAxis.cpp +++ b/motorApp/MotorSrc/asynMotorAxis.cpp @@ -60,7 +60,6 @@ asynMotorAxis::asynMotorAxis(class asynMotorController *pC, int axisNo) // Create the asynUser, connect to this axis pasynUser_ = pasynManager->createAsynUser(NULL, NULL); pasynManager->connectDevice(pasynUser_, pC->portName, axisNo); - // Initialize some parameters setIntegerParam(pC_->motorPowerAutoOnOff_, 0); setDoubleParam(pC_->motorPowerOffDelay_, 0.); diff --git a/motorApp/MotorSrc/devMotorAsyn.c b/motorApp/MotorSrc/devMotorAsyn.c index 603f49f8c..fddc3d08e 100644 --- a/motorApp/MotorSrc/devMotorAsyn.c +++ b/motorApp/MotorSrc/devMotorAsyn.c @@ -214,6 +214,12 @@ static void init_controller(struct motorRecord *pmr, asynUser *pasynUser ) initPos = 1; break; } + + /* + * STFC ISIS: force off, but we should now change our dbs and use RSTM = Never (0) + */ + initPos = 0; + if (initPos) { double setPos = pmr->dval / pmr->mres; @@ -638,7 +644,7 @@ static RTN_STATUS build_trans( motor_cmnd command, /* Queue asyn request, so we get a callback when driver is ready */ pasynUser->reason = pPvt->driverReasons[pmsg->command]; - status = pasynManager->queueRequest(pasynUser, 0, 0); + status = pasynManager->queueRequest(pasynUser, asynQueuePriorityHigh, 0); if (status != asynSuccess) { asynPrint(pasynUser, ASYN_TRACE_ERROR, "devMotorAsyn::build_trans: %s error calling queueRequest, %s\n", diff --git a/motorApp/MotorSrc/motorRecord.dbd b/motorApp/MotorSrc/motorRecord.dbd index be7c549de..f7e7c1360 100644 --- a/motorApp/MotorSrc/motorRecord.dbd +++ b/motorApp/MotorSrc/motorRecord.dbd @@ -506,12 +506,14 @@ recordtype(motor) { interest(1) } field(HOMF,DBF_SHORT) { + asl(ASL0) prompt("Home Forward") special(SPC_MOD) pp(TRUE) interest(1) } field(HOMR,DBF_SHORT) { + asl(ASL0) prompt("Home Reverse") special(SPC_MOD) pp(TRUE) @@ -846,7 +848,7 @@ recordtype(motor) { interest(2) } field(RSTM,DBF_MENU) { - initial("NearZero") + initial("Never") prompt("Restore Mode") promptgroup(GUI_COMMON) interest(2) diff --git a/motorApp/MotorSrc/motordevCom.cc b/motorApp/MotorSrc/motordevCom.cc index fb4c8d8bd..a66e7b762 100644 --- a/motorApp/MotorSrc/motordevCom.cc +++ b/motorApp/MotorSrc/motordevCom.cc @@ -306,6 +306,8 @@ motor_init_record_com(struct motorRecord *mr, int brdcnt, struct driver_table *t break; } + initPos = false; /* never init */ + /* Test for command primitive initialization string. */ initString = (mr->init != NULL && strlen(mr->init)) ? true : false; /* Test for PID support. */