#================================================================= # # Auth: 9-Jul-2008, Sonya Hoobler (sonya) # # Rem: Mostly contains records associated with user interface # See comments for individual records below. # #----------------------------------------------------------------- # # Mod: 16-Jul-2008, Sonya Hoobler (sonya) # # New algorithm to set knob sensitivity: # If DRVH>DRVL, sens=(DRVH-DRVL)/10, else if HOPR>LOPR, # sens=(HOPR-LOPR)/10, else sens = default value # # Added DESC PV to hold attached device :DESC field. # Add DESCCNT PV, increment when DESC processed. Used to # wait for CA connection during attachment. # # 15-Apr-2009, Sonya Hoobler (sonya) # # Remove SENSCALC1, SENSCALC2, SENSCALC3, SENSSEQ. # Moved sensitivity calculation to sequence program. # # Added new records for multiknob support: # MKBSENS, MKBLABEL, MKBSENSCNT, MKBLABELCNT # #================================================================= # Value of device when attached to knob # When :RESTORE PV fetches .VAL from :INITVAL, it's NPP so that # :INITVAL doesn't fetch recent value of attached PV record(ai, "KNOB:$(LOCA):$(B):K$(K)_INITVAL") { # field(TPRO, "1") field(INP, "KNOB:$(LOCA):$(B):K$(K)_DEVVAL.VAL") field(PINI, "YES") } # User can save intermediate value of device # to this record and load it later. # When :RETURN PV fetches .VAL from :SAVEDVAL, it's NPP so that # :SAVEDVAL doesn't fetch recent value of attached PV record(ai, "KNOB:$(LOCA):$(B):K$(K)_SAVEDVAL") { # field(TPRO, "1") field(INP, "KNOB:$(LOCA):$(B):K$(K)_DEVVAL.VAL") field(PINI, "YES") } # When user requests to load saved value, :RETURN is processed. # It does the following: # (1) put :SAVEDVAL.VAL to .LNK1. # Attach_detach program passes attached PV name to .LNK1 # upon attachment. record(seq, "KNOB:$(LOCA):$(B):K$(K)_RETURN") { field(SELM, "All") field(DOL1, "KNOB:$(LOCA):$(B):K$(K)_SAVEDVAL") field(DOL2, "1") } # When user requests to restore, :RESTORE is processed. # It does the following: # (1) put :INITVAL.VAL to .LNK1, which is the name of # the attached device and is passed to .LNK1 by # the attach_detach sequence program record(seq, "KNOB:$(LOCA):$(B):K$(K)_RESTORE") { field(SELM, "All") field(DOL1, "KNOB:$(LOCA):$(B):K$(K)_INITVAL") field(DOL2, "1") } # Button initiates 'return', which puts attached device value back # to :SAVEDVAL, the intermediate value saved by user record(bi, "KNOB:$(LOCA):$(B):K$(K)_GORETURN") { field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_RETURNCHK") field(ASG, "MCC") } # Button initiates 'restore', which puts attached device value back # to what it was when first assigned # When user presses button, FLNK to restore sequence pv record(bi, "KNOB:$(LOCA):$(B):K$(K)_GORESTORE") { field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_RESTORCHK") field(ASG, "MCC") } # Processed by edm button to save the present value # of the attached device. User can then load this # value later if desired. record(bi, "KNOB:$(LOCA):$(B):K$(K)_GOSAVE") { field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_SAVEDVAL") field(ASG, "MCC") } # Only 'restore' if knob is in 'attached' state record(calcout, "KNOB:$(LOCA):$(B):K$(K)_RESTORCHK") { field(CALC, "2-A") field(INPA, "KNOB:$(LOCA):$(B):K$(K)_STATE") field(OUT, "KNOB:$(LOCA):$(B):K$(K)_RESTORE PP") field(OOPT, "When Zero") } # Only 'return' if knob is in 'attached' state record(calcout, "KNOB:$(LOCA):$(B):K$(K)_RETURNCHK") { field(CALC, "2-A") field(INPA, "KNOB:$(LOCA):$(B):K$(K)_STATE") field(OUT, "KNOB:$(LOCA):$(B):K$(K)_RETURN PP") field(OOPT, "When Zero") } # Check to see what state knob is in. If :STATE.VAL = 3, # the knob is in 'new detach' state. # We don't want to attach a knob while detach functions # are occurring, so if :STATE.VAL=3, don't attach knob. record(calcout, "KNOB:$(LOCA):$(B):K$(K)_PUTATTACH") { field(CALC, "A-3") field(INPA, "KNOB:$(LOCA):$(B):K$(K)_STATE.VAL NPP") field(OUT, "KNOB:$(LOCA):$(B):K$(K)_STATE PP") field(OOPT, "When Non-zero") field(DOPT, "Use OCAL") field(OCAL, "1") } # Holds name of attached pv. # FLNK to :PUTATTACH in order to start attach functions when user # hits carriage return (instead of requiring attach button). record(stringin, "KNOB:$(LOCA):$(B):K$(K)_DEVNAME") { # field(TPRO, "1") field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_PUTATTACH") field(ASG, "MCC") } # Holds .LOPR of attached device # device.LOPR passed to INP by attach_detach_msg record(ai, "KNOB:$(LOCA):$(B):K$(K)_DEV_LOPR") { # field(TPRO, "1") field(SCAN, "Passive") } # Holds .HOPR of attached device # device.HOPR passed to INP field by attach_detach_msg record(ai, "KNOB:$(LOCA):$(B):K$(K)_DEV_HOPR") { # field(TPRO, "1") field(SCAN, "Passive") } # Holds .NAME of attached device record(stringin, "KNOB:$(LOCA):$(B):K$(K)_NAME") { field(SCAN, "Passive") } # Holds message displayed to user on edm screen record(stringin, "KNOB:$(LOCA):$(B):K$(K)_MSG") { field(PINI, "YES") } # Set by attach_detach_msg # Used to calculate knob sensitivity record(ai, "KNOB:$(LOCA):$(B):K$(K)_SENS_FACT") { field(VAL, "10") field(PINI, "YES") } record(stringin, "KNOB:$(LOCA):$(B):K$(K)_EGU") { # field(TPRO, "1") field(SCAN, "Passive") field(PINI, "YES") } record(ai, "KNOB:$(LOCA):$(B):K$(K)_DISPVAL") { field(PINI, "YES") field(INP, "KNOB:$(LOCA):$(B):K$(K)_DEVVAL.VAL CP") } # Put 3 to :STATE, which indicates new detach record(seq, "KNOB:$(LOCA):$(B):K$(K)_GODETACH") { # field(TPRO, "1") field(SELM, "All") field(DOL1, "3") field(LNK1, "KNOB:$(LOCA):$(B):K$(K)_STATE PP") field(ASG, "MCC") } # Holds :DESC field of attached device record(stringin, "KNOB:$(LOCA):$(B):K$(K)_DESC") { field(SCAN, "Passive") field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_DESCCNT") } # Increments when DESC is processed. # When >=1, it means DESC has got its val from the attached PV. # Used in attach_detach_msg during attachment. record(calc, "KNOB:$(LOCA):$(B):K$(K)_DESCCNT") { field(VAL, "0") field(CALC, "A+1") field(INPA, "KNOB:$(LOCA):$(B):K$(K)_DESCCNT.VAL") } # Holds attached device DRVL value # device.DRVL passed to INP by attach_detach_msg record(ai, "KNOB:$(LOCA):$(B):K$(K)_DEV_DRVL") { field(SCAN, "Passive") # field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_SENSCALC1") } # Holds attached device DRHL value # device.DRVH passed to INP by attach_detach_msg record(ai, "KNOB:$(LOCA):$(B):K$(K)_DEV_DRVH") { field(SCAN, "Passive") # field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_SENSCALC1") } # For mkb only, holds mkb sens # If 0, use our standard calculation/default # mkb:SENS passed to INP by attach_detach_msg record(ai, "KNOB:$(LOCA):$(B):K$(K)_MKBSENS") { field(SCAN, "Passive") field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_MKBSENSCNT") } # Increments when MKBSENS is processed. # When >=1, it means MKBSENS has got its val from the attached PV. # Used in attach_detach_msg during attachment. record(calc, "KNOB:$(LOCA):$(B):K$(K)_MKBSENSCNT") { field(VAL, "0") field(CALC, "A+1") field(INPA, "KNOB:$(LOCA):$(B):K$(K)_MKBSENSCNT.VAL") } # For mkb only, holds mkb label # If 0, use our standard calculation/default? # mkb:LABEL passed to INP by attach_detach_msg record(stringin, "KNOB:$(LOCA):$(B):K$(K)_MKBLABEL") { field(SCAN, "Passive") field(FLNK, "KNOB:$(LOCA):$(B):K$(K)_MKBLABELCNT") } # Increments when MKBLABEL is processed. # When >=1, it means MKBLABEL has got its val from the attached PV. # Used in attach_detach_msg during attachment. record(calc, "KNOB:$(LOCA):$(B):K$(K)_MKBLABELCNT") { field(VAL, "0") field(CALC, "A+1") field(INPA, "KNOB:$(LOCA):$(B):K$(K)_MKBLABELCNT.VAL") }