Current status of the detector tower.

This commit is contained in:
2025-03-10 14:27:19 +01:00
parent bb492e678b
commit 3a3519fbaa
9 changed files with 249 additions and 156 deletions

View File

@ -1,26 +1,38 @@
# Reset any errors of the virtual axis.
# This record is coupled to the parameter library via resetError_ -> RESET_ERROR.
record(longout, "$(INSTR)$(M):ResetError") {
# Set to 0 to move the tower into working state and to 1 to move into changer position
record(longout, "$(INSTR)$(M):ChangeState") {
field(DTYP, "asynInt32")
field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) RESET_ERROR")
field(PINI, "NO")
}
# Start the movement into the position defined by DetectorTower, LiftOffset and TiltOffset
record(longout, "$(INSTR)$(M):MoveToWorkingPosition") {
field(DTYP, "asynInt32")
field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) MOVE_TO_WORKING_POSITION")
field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) CHANGE_STATE")
field(PINI, "NO")
field(DRVH, "1")
field(DRVL, "0")
}
# Read the position state of the axis:
# 0 = not ready
# 1 = ready (in working position)
# 2 = Moving from working to changer position or in changer position
# 2 = Moving from changer to working position
record(longout, "$(INSTR)$(M):PositionState")
# 3 = Moving from changer to working state
record(longin, "$(INSTR)$(M):PositionStateRBV")
{
field(DTYP, "asynInt32")
field(OUT, "@asyn($(CONTROLLER),$(AXIS)) POSITION_STATE")
field(INP, "@asyn($(CONTROLLER),$(AXIS)) POSITION_STATE_RBV")
field(SCAN, "I/O Intr")
}
field(PINI, "NO")
}
# This PV combines the position state and the movement readback value from the
# motor record:
# - 0, if the tower is in working state or transitioning to change position
# - 1, If the tower is in change position or transitioning to working state
record(calc, "$(INSTR)$(M):ChangingStateRBV")
{
field(INPA, "$(INSTR)$(M).MOVN CP")
field(INPB, "$(INSTR)$(M):PositionStateRBV CP")
field(CALC, "(B == 1 || (B == 2 && A == 1)) ? 0 : 1")
}
# Convert the double value from the calc record to an integer value
record(longout, "$(INSTR)$(M):ChangingStateRBV_int") {
field(DOL, "$(INSTR)$(M):ChangingStateRBV CP")
field(OMSL, "closed_loop")
}