#! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Note: for slave with trim coils # set the macro ACT to the following: # ACT=:IACTCALC record(ai, "$(DEVICE):IACT") { field(DESC, "Current") field(INP, "$(PS)IACT CP NMS") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "$(DEVICE):IACTCALC") info(autosaveFields,"HYST") } record(bi, "$(DEVICE):STATE") { field(DESC, "PS On/Off Status") field(DTYP, "Raw Soft Channel") field(INP, "$(PS)STATE CP MS") field(ZSV, "MAJOR") field(ZNAM, "OFF") field(ONAM, "ON") } record(ao, "$(DEVICE):IDES") { field(DESC, "Desired Current") field(PREC, "3") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(MDEL, "-1") field(HIHI, "$(IMAX)") field(LOLO, "$(IMIN)") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "$(DEVICE):BDELTAS") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(DOL, "$(DEVICE):B2IDES.K") field(OMSL, "closed_loop") # Note: set LNK to blank for Large PS (LGPS) # where the user doesn't have any analog control # as the ps voltae/current is always set to imax # field(OUT, "$(DEVICE):ICTRL PP") } # This record is processed by $(DEVICE):ICON") # Note: we are not setting alarms here. record(ao, "$(DEVICE):ICON") { field(DESC, "Config I") field(DTYP, "Soft Channel") field(PREC, "3") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(DOL, "$(DEVICE):B2ICON.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):INOM") { field(DESC, "Nominal Current") field(DOL, "$(DEVICE):BNOM.K") field(OMSL, "closed_loop") field(PREC, "3") field(EGU, "A") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") } record(ao, "$(DEVICE):ICTRL") { field(DESC, "Set Current") field(PREC, "3") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(MDEL, "-1") field(FLNK, "$(DEVICE):ICTRLGO") field(OMSL, "supervisory") info(autosavefields,"VAL") } record(seq, "$(DEVICE):ICTRLGO") { field(DESC, "Process Current Setpoint") field(PREC, "3") # Set ISETPT to supervisory field(DOL1, "0") field(LNK1, "$(DEVICE):ISETPT.OMSL") field(DOL2, "$(DEVICE):ICTRL") field(LNK2, "$(DEVICE):ISETPT PP") # Set ISETPT to closed loop - get data from BCTRLSUB.K field(DOL3, "1") field(LNK3, "$(DEVICE):ISETPT.OMSL") } record(ao, "$(DEVICE):IMAX") { field(DESC, "Max I") field(DTYP, "Soft Channel") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(PINI, "YES") field(VAL, "$(IMAX)") field(FLNK, "$(DEVICE):IMIN") } record(ao, "$(DEVICE):IMIN") { field(DESC, "Min I") field(DTYP, "Soft Channel") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(VAL, "$(IMIN)") field(FLNK, "$(DEVICE):IRANGE") } record(sel, "$(DEVICE):IACTPREVOK") { field(DESC, "Last Good Current") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(NVL, "$(DEVICE):BACT.SEVR") field(INPA, "$(DEVICE):IACT NPP MS") field(INPB, "$(DEVICE):IACTPREVOK NPP MS") field(INPC, "$(DEVICE):IACTPREVOK NPP MS") field(INPD, "$(DEVICE):IACTPREVOK NPP MS") } record(sub, "$(DEVICE):IACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "$(DEVICE):IDES") field(INPB, "$(DEVICE):ISETPT.DRVH") field(INPC, "$(DEVICE):ISETPT.DRVL") field(INPD, "$(DEVICE):IDELTAS.I") field(INPE, "$(DEVICE):IDELTAS.J") field(INPG, "$(DEVICE):STATE") field(INPH, "$(DEVICE):HSTA") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(BRSV, "INVALID") } record(sub, "$(DEVICE):IMONLIMITS") { field(DESC, "Aux Current Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "$(DEVICE):IDES") field(INPB, "$(DEVICE):ISETPT.DRVH") field(INPC, "$(DEVICE):ISETPT.DRVL") field(INPD, "$(DEVICE):IDELTAS.K") field(INPE, "$(DEVICE):IDELTAS.L") field(INPG, "$(DEVICE):STATE") field(INPH, "$(DEVICE):HSTA") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(BRSV, "INVALID") } record(seq, "$(DEVICE):ILIMITS") { field(DESC, "Set ACT and MON Limits") field(PREC, "3") field(DOL1, "$(DEVICE):BLIMITS") field(LNK1, "$(DEVICE):IACTLIMITS.F PP") field(DOL2, "$(DEVICE):IACTLIMITS.I") field(LNK2, "$(DEVICE):IACT.HIGH") field(DOL3, "$(DEVICE):IACTLIMITS.J") field(LNK3, "$(DEVICE):IACT.LOW") field(DOL4, "$(DEVICE):IACTLIMITS.K") field(LNK4, "$(DEVICE):IACT.HIHI") field(DOL5, "$(DEVICE):IACTLIMITS.L") field(LNK5, "$(DEVICE):IACT.LOLO") field(DOL6, "$(DEVICE):BLIMITS") field(LNK6, "$(DEVICE):IMONLIMITS.F PP") field(DOL7, "$(DEVICE):IMONLIMITS.I") field(LNK7, "$(DEVICE):IMON.HIGH") field(DOL8, "$(DEVICE):IMONLIMITS.J") field(LNK8, "$(DEVICE):IMON.LOW") field(DOL9, "$(DEVICE):IMONLIMITS.K") field(LNK9, "$(DEVICE):IMON.HIHI") field(DOLA, "$(DEVICE):IMONLIMITS.L") field(LNKA, "$(DEVICE):IMON.LOLO") } # Outputs: # ------- # Inputs B and C are use for calibration and standardization. # ATOL(1) is the loose tolerance on the desired current-ADC measured current # ATOL(2) is the fractional tolerance. # A = Desired Value (not used) # B = Caculated stdz tolerance as % of max current (slc ATOL(1)) # C = Minimum stdz tolerance (slc ATOL(2)) # I = ACT warning delta (slc TOLMX) # J = ACT alarm delta (slc CURR_TOL) # K = MON warning delta # L = MON alarm delta # VAL = standardize tolerance max(b,c) # record(sSub, "$(DEVICE):IDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntRawDeltas") field(INPD, "$(DEVICE):TRIMBTOL") field(INPE, "$(DEVICE):CHCKBTOL") field(INPF, "$(DEVICE):BDELTAS.K") field(INPG, "$(DEVICE):BDELTAS.L") field(INPH, "$(DEVICE):B2IDES.L") field(EGU, "A") field(HOPR, "1") field(PREC, "3") field(BRSV, "INVALID") # # Used to calcualte standardize tolerance # which is returned in the VAL field. # field(INPB, "$(DEVICE):STDZITOLR") field(INPC, "$(DEVICE):STDZITOL") field(FLNK, "") } # All ps controllers with on/off control will set the macro ONOF # as follows: # # ONOF = $(PS)STATESETPT PP # # Only slaves and the MCOR systems DO NOT have on/off controls # of the ps. However, slaves get their ps On/Off status from the main. # so the ONOF macro as defined above is unchanged. The MCOR system # would set the ONOF macro to blank (default). However, the MCOR soft # pvs for STATESETPT is a place holder that outpts nothing, so the ONOF # macro can also be set to the ONOFF macro listed above. # # The hard and soft x-ray chicane magnets in the undulator and the # xleap chicane in the ltu are powerd by MCOR. In addition, a chassis # was built to provide individual MCOR channel on/off control. This # chassis includes a contactor and beckhoff digial i/o. For these # chicane magnets set the ONOF macro to the following: # # ONOF = :CONTACTOR_SETPT PP # # Note: since the chicane magnets are powered by an MCOR # the PS macro will be set to an MCOR channel PV, different # than the contactor pvs for on/off control. # record(bo, "$(DEVICE):STATESETPT") { field(DESC, "PS On/Off") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(OUT, "") info(autosaveFields,"VAL RVAL") } # Only the MCOR and slaves set the macros RST to the default # all other ps controllers with Fault Reset control should set # the macro as follows: # RST = $(PS)RESET PP # record(bo, "$(DEVICE):RESET") { field(DESC, "Interlock Latch Reset") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFF") field(ONAM, "ON") field(HIGH, "1.0") field(OUT, "") } record(bo, "$(DEVICE):RAMPSTATE") { field(DESC, "PS Ramp Status") field(DTYP, "Soft Channel") field(DOL, "$(PS)RAMPSTATE CP MS") field(OMSL, "closed_loop") field(ZNAM, "OFF") field(ONAM, "BUSY") field(OSV, "MINOR") field(PINI, "NO") } # Ramp rate is defined in LCLS PRD 1.1-015 # Default: MCORs 1A/sec and EPSC 10A/sec # Note: On boot this pv is processed # by :TRIMRAMPRATE record(ao, "$(DEVICE):IRAMPRATE") { field(DESC, "Current Setpoint dI/dt limit") field(DTYP, "Soft Channel") field(DRVH, "20.0") field(DRVL, "0.1") field(HOPR, "20") field(LOPR, "0.1") field(EGU, "A/sec") field(PREC, "3") # Set default to trim ramp rate on boot # but need to change for degauss function. field(DOL, "$(DEVICE):TRIMRAMPRATE") field(OUT, "") field(FLNK, "$(DEVICE):STDZDLY") } record(ao, "$(DEVICE):ISETPT") { field(DESC, "Current Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(DRVH, "$(IMAX)") field(DRVL, "$(IMIN)") field(MDEL, "-1") field(OUT, "") field(DOL, "$(DEVICE):BCTRLSUB.K") field(OMSL, "closed_loop") info(autosaveFields,"VAL") } # Note: for slave with trim coils # set the macro MONFL to the following: # MONFL=:IMONCALC record(ai, "$(DEVICE):IMON") { field(DESC, "Aux Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(INP, "$(PS)IMON CP NMS") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(PREC, "3") field(HHSV, "MAJOR") field(LLSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(FLNK, "$(DEVICE):IMONCALC") } record(ao, "$(DEVICE):IRIPL") { field(DESC, "Ripple Current") field(DTYP, "Soft Channel") field(PINI, "YES") field(DOL, "$(PS)IRIPL CP NMS") field(OMSL, "closed_loop") field(EGU, "A") field(DRVH, "1.0") field(HOPR, "1.0") field(PREC, "3") field(FLNK, "$(DEVICE):IRIPLOK") } record(sub, "$(DEVICE):IRIPLOK") { field(DESC, "Ripple Current Status") field(INAM, "mgntInit") field(SNAM, "mgntRiplOK") field(INPA, "$(DEVICE):IRIPL.VAL") field(INPB, "$(DEVICE):IDELTAS.J") field(D, "2.0") } # Resistance only available for # Kickers and Magnets controlled by # Ethernet PS Controllers. Resistance # is not available for MCOR Bulks # and magnets controlled by MCORs # Note: The alarm status origniates from the input PV record(ao, "$(DEVICE):R") { field(DESC, "Resistance") field(EGU, "Ohms") field(PREC, "4") field(PINI, "YES") field(DOL, "$(PS)R CP NMS") field(OMSL, "closed_loop") } # Gound current is only available for # some Bulks, Kickers and Magnets controlled by # Ethernet PS Controllers. Ground current # is not available for magnets controlled by MCORs # Note: The alarm status origniates from the input PV record(ao, "$(DEVICE):IGND") { field(DESC, "Ground Current") field(EGU, "A") field(PREC, "6") field(PINI, "YES") field(DOL, "$(PS)IGND CP MS") field(OMSL, "closed_loop") } record(bi, "$(DEVICE):INTLKSUMY") { field(DESC, "Interlock Summary") field(INP, "$(PS)INTLKSUMY CP MS") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") field(ZNAM, "OK") field(ONAM, "FAULT") field(PINI, "NO") } record(mbbo, "$(DEVICE):COOLING") { field(DESC, "Type of cooling") field(NOBT, "2") field(ZRST, "AIR") field(ONST, "WATER") field(TWST, "HELIUM") field(THST, "NONE") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(PINI, "NO") field(DOL, "$(PS)COOLING CP NMS") field(OMSL, "closed_loop") } # The following PV is processed by :BACTFO # which is processed by :BACT record(fanout, "$(DEVICE):IACTFO") { field(DESC, "IACT processing") field(SELM, "All") field(LNK1, "$(DEVICE):IACTPREVOK") field(LNK2, "$(DEVICE):IDIFF") field(LNK3, "$(DEVICE):IADIFF") field(LNK4, "$(DEVICE):IRATIO") field(LNK5, "$(DEVICE):IDIRECT") field(LNK6, "$(DEVICE):IACTPOL_CHECK") } record(calc, "$(DEVICE):IDIFF") { field(DESC, "IDES-IACT") field(CALC, "A-B") field(INPA, "$(DEVICE):IDES") field(INPB, "$(DEVICE):IACT") field(EGU, "A") field(PREC, "9") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") } record(calc, "$(DEVICE):IADIFF") { field(DESC, "Absolute IDES-IACT") field(CALC, "A<0?ABS(A):A") field(INPA, "$(DEVICE):IDIFF") field(PREC, "9") } record(calc, "$(DEVICE):IRATIO") { field(DESC, "IDES-IACT/IMAX") field(CALC, "B?A/B:0") field(INPA, "$(DEVICE):IDIFF") field(INPB, "$(DEVICE):IDES.DRVH") field(PREC, "9") } record(calcout, "$(DEVICE):IRANGE") { field(DESC, "Current Range") field(PINI, "YES") field(CALC, "ABS(A-B)") field(INPA, "$(DEVICE):IMIN") field(INPB, "$(DEVICE):IMAX") field(PREC, "9") } # Process IDIRECT upon a new IDES, prior to setting ISETPT (or ICTRL) # which in turn updates IACT # # Note: This pv is processed by BCTLLSUB record(calcout, "$(DEVICE):IDIRECT") { field(DESC, "Setting I 0=up,1=down") # # if CTRL.RVAL==2==Trim,then compare IDES w IACT; otherwise # if CTRL.RVAL==7==Dac Zero, then compare 0 with IACT, otherwise compare IDES w ISETPT # field(CALC, "D==2?((B=1?0:1") field(INPA, "$(DEVICE):IACT") field(FLNK, "$(DEVICE):IACTPOL") } record(bo, "$(DEVICE):IACTPOL") { field(DESC, "Actual I Polarity") field(DTYP, "Raw Soft Channel") field(DOL, "$(DEVICE):IACTPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") info(autosaveFields,"VAL RVAL") } #! TextBox(TB9,980,1478,1300,1618,0,"Dialog",12,1,16777215,"$(DEVICE):I*LIMITS:\n Calculate alarm and warning limits based on \n deltas from $(DEVICE):IDELTAS and the\n $(DEVICE):IDES value. \n Limits can be \"disabled\" (or set to drive \n limits) on several conditions (the device is off, \n setpoint is changing, deltas cannot be \n calculated due to bad inputs).\n ",null) #! TextBox(TB8,361,1340,721,1420,0,"Dialog",12,1,16777215,"$(DEVICE):IACT: \n Get copy of $(DEVICE):I. \n",null) #! TextBox(TB12,1280,3100,1760,3200,0,"Dialog",12,1,16777215,"$(DEVICE):ICTRL and CTRLGO:\n CTRL is set by users to update the hardware directly. CTRL forces \n processing of CTRLGO and, if enabled, CTRLGO copies CTRL to SETPT\n and processes it. When feedback is ON, CTRLGO is disabled and\n CTRL is periodically processed.\n ",null) #! TextBox(TB6,52,1458,352,1858,0,"Dialog",12,1,16777215,"$(DEVICE):IDES:\n Contains raw value calculated by \n$(DEVICE):B2IDES. This record is periodically\nupdated when fast feedback is on. \n\nIt is assumed that the calibration and/or \nstandardization sequence will set the HIGH and \nLOW limits of IDES and in this case, \nIDES.HIGH is the same as IMAX in the \nSLC database. If the sequence sets these, they \nwill need to be saved and restored across IOC \nreboots. This record forces processing (via \nFLNK) of less time-critical records starting with \n$(DEVICE):BDELTAS.\n",null) #! TextBox(TB10,56,1940,316,2340,0,"Dialog",12,1,16777215,"$(DEVICE):IDELTAS:\n Calculate delta used for standardization.\n Also, calculate alarm and warning deltas \n for ACT and MON based on the deltas for\n the physical units. Multiply the physical\n deltas by the slope to get an approximate\n corresponding raw delta.\n This record is processed after \n $(DEVICE):BDELTAS (via FLNK).\n Input:\n A = Desired Value\n B = Absolute delta for standardization\n C = Fraction of desired value for\n standardization delta\n D to G = Deltas in physical units from \n $(DEVICE):BDELTAS\n H = Approximate raw-to-physical slope\n Output:\n I to L = Deltas in raw units \n VAL = Standardization Delta\n\n",null) #! TextBox(TB5,2120,3120,2560,3240,0,"Dialog",12,1,16777215,"$(DEVICE):ISETPT:\n Sets the hardware. When fast feedback is set on, this record is\n set to closed loop mode by $(DEVICE):FBCKSTART sequence. When \n the loop is closed, this record takes input calculated by \n BFBCK only. When fast feedback is set off, $(DEVICE):FBCKSTOP \n will set it back to supervisory so that the value can be set by \n $(DEVICE):ICTRLGO. \n",null) #! TextBox(TB4,457,1456,877,1956,0,"Dialog",12,1,16777215,"Macros:\nDEV = PRIM:LOCA:UNIT\nPHY = for magnets: B\n = for phase and amplitude: P or A\nRAW = for magnets: I\n = for phase and amplitude: V \nEGU = Engineering Units \nDRVH, DRVL = High and Low Drive Limits\n NOTE: DRVH, DRVL same as IMMO in the SLC database\nHIHI, LOLO = High and Low Limits for \n Standardization and Calibration\n NOTE: HIHI, LOLO same as IMMS in the SLC database\nPREC = Precision (# after the decimal point)\nADEL = Readback Archive Delta Amount\n\nSCAN = SCAN rate of ACT, MON, and RIPL\nDTYPI = Device Type of ACT, MON, and RIPL\nDTYPO = Device Type for ISETPT\nINPA = Input for I\nINPM = Input for MON\nOUT = Output for DES\nRAMPRATE = default PS ramprate di/dt\n",null) #! TextBox(TB3,745,1385,1305,1425,0,"Dialog",18,1,16777215,"Controlled Devices - Raw Engineering Units Records",null) #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(stringout, "$(DEVICE):TRIMTOD") { field(DESC, "Last successful TRIM") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):TRIMTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "$(DEVICE):TRIMTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "$(DEVICE):TRIMTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } record(longout, "$(DEVICE):TRIMTRYCNT") { field(DESC, "No of tries to TRIM") field(PINI, "YES") field(VAL, "0") } # This pv is processed by :CONFIG record(bo, "$(DEVICE):TRIMTYPE") { field(DESC, "Trim algorithm") field(VAL, "1") field(ZNAM, "3_LINEAR") field(ONAM, "LINEAR") field(FLNK, "$(DEVICE):TRIMMAXNUMCHK") } # If magnet is a slave then set max trim tries to 0 # Otherwise, if trim type is linear then set # max trim tries to 1, else we have an mcor so set to the # default of 10. record(calcout, "$(DEVICE):TRIMMAXNUMCHK") { field(CALC, "B==1?0:A?1:10") field(INPA, "$(DEVICE):TRIMTYPE.RVAL") field(INPB, "$(DEVICE):CONFIG.RVAL") field(OUT, "$(DEVICE):TRIMMAXNUM PP") } record(longout, "$(DEVICE):TRIMMAXNUM") { field(DESC, "Max TRIM tries") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") } # Trim ramp rate saved in static restore file # Note: on boot set the trim ramp rate # the trim ramp rate is used for standardize # but the degauss function sets it's own # ramp rate. # Note: if this is a string slave then # set the ramp rate to the main. record(ao, "$(DEVICE):TRIMRAMPRATE") { field(DESC, "Trim Ramp rate ") field(PINI, "YES") field(ASG, "IOC_MAINT") field(PREC, "3") field(EGU, "A/sec") field(HOPR, "20.0") field(DRVH, "20.0") field(DRVL, "0.1") field(LOPR, "0.5") field(DOL, "$(PS)TRIMRAMPRATE CP NMS") field(OMSL, "closed_loop") field(VAL, "") field(OUT, "$(DEVICE):IRAMPRATE PP") } # Trim settle time saved in static restore file record(ao, "$(DEVICE):TRIMSETL") { field(DESC, "TRIM Settle Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(EGU, "sec") field(DRVH, "60.0") field(DRVL, "0.0") field(HOPR, "60") field(LOPR, "0.0") field(DOL, "$(PS)TRIMSETL CP NMS") field(OMSL, "closed_loop") field(VAL, "") } record(bo, "$(DEVICE):TRIMOK") { field(DESC, "Trim Successful") field(PINI, "YES") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(COSV, "NO_ALARM") info(autosaveFields, "VAL RVAL") } record(ao, "$(DEVICE):TRIMDLYPCT") { field(DESC, "Trim Ramp Delay %") field(EGU, "sec") field(DRVH, "100.0") field(DRVL, "0.0") field(HOPR, "100") field(LOPR, "0.0") field(VAL, "10.0") field(PINI, "YES") field(DTYP, "Soft Channel") } # Note: only for mcor's that use ipac modules record(ao, "$(DEVICE):TRIMSTEPMIN") { field(DESC, "Min step in current") field(DTYP, "Soft Channel") # field(DOL, "") field(PREC, "7") field(EGUF, "10") field(EGUL, "0") field(EGU, "A") field(HOPR, "10") field(LOPR, "0") field(VAL, "1") } record(bo, "$(DEVICE):SOFTRAMP") { field(DESC, "Soft Ramp Enable") field(DTYP, "Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") } record(ao, "$(DEVICE):SOFTSTEPTIME") { field(DESC, "Time between steps") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "10.0") field(DRVL, "0.1") field(EGU, "sec") field(HOPR, "10.0") field(LOPR, "0.1") # Set the default delay between softramp steps as 0.1 sec # which is used for MCOR controlled magnets. Note that # only MCOR currently use softramp. field(VAL, "0.1") field(PREC, "3") } # ---- Calcualted Ramp time PVs ----- # # Populated by sequence # This pv forces the ramp time to be calculated. # Therefore, the ramp rate PV must be update first. record(ao, "$(DEVICE):IMOVE") { field(DESC, "Ramp distance") field(EGU, "A") field(PINI, "YES") field(VAL, "0") field(FLNK, "$(DEVICE):RAMPTIME") } # ramp time based on current distance and ramp rate, # Note: EPSC use cosine ramp,and a load facter C is used. # # D - multiplying factor (3.154/2 = 1.577) -- only for EPSC's. # Otherwise set to 1.0 record(calcout, "$(DEVICE):RAMPTIME") { field(DESC, "Calc Ramp Time (sec)") field(CALC, "C>0?MAX(G,ABS((A-B)/C)*D*(1+E/100)):0") # field(CALC, "MAX(0,ABS(F))") field(INPA, "$(DEVICE):IMOVE") field(INPB, "$(DEVICE):IACT") field(INPC, "$(DEVICE):IRAMPRATE") field(INPD, "1.577") field(INPE, "$(DEVICE):TRIMDLYPCT") field(INPF, "$(DEVICE):STDZRAMPDLY") field(INPG, "0.5") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") field(OUT, "$(DEVICE):RAMPTIME_LEFT PP") } record(longout, "$(DEVICE):RAMPTIME_LEFT") { field(DESC, "Ramp time left (sec)") field(EGU, "sec") field(OUT, "$(DEVICE):RAMPTIME_MINUTES_LEFT.A PP") field(FLNK, "$(DEVICE):RAMPDONE_CALC") } record(calc, "$(DEVICE):RAMPTIME_MINUTES_LEFT") { field(DESC, "Ramp time left (min)") field(EGU, "minutes") field(CALC, "A/60") field(INPA, "$(DEVICE):RAMPTIME_LEFT") field(PREC, "2") field(FLNK, "$(DEVICE):RAMPTIME_LEFT_CALC") } # Decrement the ramp time remaining by seconds record(calcout, "$(DEVICE):RAMPTIME_LEFT_CALC") { field(DESC, "Increment ramp time (sec)") field(SCAN, "1 second") field(CALC, "A>0?A-1:0") field(OOPT, "On Change") field(INPA, "$(DEVICE):RAMPTIME_LEFT") field(OUT, "$(DEVICE):RAMPTIME_LEFT PP MS") field(ASG, "Internal") } record(calcout, "$(DEVICE):RAMPDONE_CALC") { field(DESC, "Calc ramp time expired") field(ASG, "Internal") field(CALC, "C?1:0") field(OOPT, "On Change") field(INPA, "$(DEVICE):RAMPTIME_LEFT NMS") field(OUT, "$(DEVICE):RAMPDONE PP") } record(bo, "$(DEVICE):RAMPDONE") { field(DESC, "Ramp time expired") field(DOL, "$(DEVICE):RAMPDONE_CALC") field(OMSL, "closed_loop") field(ZNAM, "Done") field(ONAM, "Ramping") } record(bo, "$(DEVICE):TRIMIFINTOL") { field(DESC, "Trim if in tolerance") field(DTYP, "Raw Soft Channel") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") field(PINI, "YES") } record(ao, "$(DEVICE):DACZERORAMPTIME") { field(DESC, "DAC Zero ramp time (sec)") field(EGU, "sec") field(DRVH, "120") field(DRVL, "0") field(HOPR, "120") field(LOPR, "0") field(VAL, "0") field(PINI, "YES") field(DTYP, "Soft Channel") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(seq, "$(DEVICE):STDZINIT") { field(DESC, "Proc. Stdz PVs on boot") field(PINI, "YES") field(DOL1, "1") field(DOL2, "1") field(DOL3, "1") field(LNK1, "$(DEVICE):DEBUG.PROC PP") field(LNK2, "$(DEVICE):STDZCYCLENUM.PROC PP") field(LNK3, "$(DEVICE):STDZDISABLE.PROC PP") field(LNK4, "$(DEVICE):STDZSUB.DISV PP") field(ASG, "Internal") } # Inputs: # A - minimum current set point # B - maximum current set point # C - final current set point # D - Number of cycles, where one cycle is min to max for stdzdirect=up (0) # or from imax to imin for stdzdirect=down (1). # The total number of set points would be 2*D+1 # E - Standardize direction (up=0,down=1). The standardize direction # is defined by magnet measurements (MMF). For lcls, all magnets # are standardized in the up direction, which means that the standardize # cycle would starts at imin to imax. If the direction was down, then the standardize # cycle would start from imax to imin. # F - Standardize disabled (0=enabled, 1=disabled) # G - Debug flag from the pv :DEBUG # # The standardize function is available for all controllable devices, but it is # typically only used for larger magnets (steel), powered by high current # supplies. These magnets tend to build up a residual field over time. This would # typically dipoles and quadrupoles. Saying this, the undulator quadrupoles, powered by 2A supplies # and these magnets are standardized. Therefore, to get a complete list of magnets that # should bestandardized for consulte the LCLS PRD 1.1-015, which provides a list, This # document also provides a list of standardize magnet groups, number of cycles, standardize # ramprates and settle times. # # A: :STDZIMIN # B: :STDZIMAX # C: :STDZIFINAL # D: :STDZCYCLENUM # E: :STDZDIRECT # F: :STDZDISABLE # G: :DEBUG # # The success or failure of the standardize function is set # in the pv :STDZOK, and the magnet is restored to the # desired b-field :BDES. # # :STDZOK (1=successfuly completed, 0=failed) # # The standardize function is available for individual magnets, # or the main (defined in db) of a string. Some indiviaul magnets are grouped # with a magnet string, such as boosts, trims or sometimes magnets # nearby a large magnet string. These groupings are defined in the # PRD 1.1-015. # # This PV is processed by :STDZIFINAL record(aSub, "$(DEVICE):STDZSUB") { field(DESC, "Stdz subroutine") field(INAM, "mgntStdzInit") field(SNAM, "mgntStdz") field(BRSV, "INVALID") field(INPA, "$(DEVICE):STDZIMIN NPP NMS") field(INPB, "$(DEVICE):STDZIMAX NPP NMS") field(INPC, "$(DEVICE):STDZIFINAL NPP NMS") field(INPD, "$(DEVICE):STDZCYCLENUM NPP NMS") field(INPE, "$(DEVICE):STDZDIRECT.RVAL NPP NMS") field(INPF, "$(DEVICE):STDZDISABLE.RVAL CPP NMS") field(INPG, "$(DEVICE):DEBUG.RVAL NPP NMS") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTC, "DOUBLE") field(FTD, "LONG") field(FTE, "ULONG") field(FTE, "ULONG") field(FTG, "ULONG") # Outputs: # OUTA: set point waveform # OUTB: mgntStdz status message # Note: the aSub sets the NORD field fo the # waveform record based on the value in NOVA. # # If NOVA changes, make sure that :STDZWF.NELM # is equal or greater than :STDZSUB.NOVA # field(OUTA, "$(DEVICE):STDZWF PP") field(OUTB, "$(DEVICE):STDZMSG PP") field(FTVA, "DOUBLE") field(FTVB, "USHORT") field(NOVA, "21") # On boot disable this PV from processing, # enabled processing from the pv # :STDZINIT, after all input pvs # have been processed. field(DISV, "0") field(FLNK, "$(DEVICE):STDZWF") } record(mbbo, "$(DEVICE):STDZMSG") { field(DESC, "STDZSUB pv status") field(NOBT, "2") field(ZRST, "Success") field(ONST, "None") field(TWST, "Wf too small") field(THST, "Unexepcted data type") } # This is the standardize waveform, generated by # the :STDZSUB # Note: :STDZWF.NELM must be equal or greater than :STDZSUB.NOVA record(waveform, "$(DEVICE):STDZWF") { field(DESC, "Stdz Setpts") field(NELM, "21") field(FTVL, "DOUBLE") } # # METHOD TO RESTORE A MULTI-BIT BINARY OUT and BO's # 1. DON'T DEFINE DOL # 2. SET PINI TO YES # 3. RESTORE THE VAL FIELD # ON THE VERY FIRST BOOT YOU MUST DO # A CAPUT TO THE MBBO AND THEN ON REBOOT # THE UDF WILL BE SET TO 0 AND THE VALUE # WILL BE RESTORED PROPERLY. # # IMPORTANT: # IF YOU DO NOT DO A CAPUT ON THE VERY FIRST BOOT, THE UDF # WILL BE SET TO 1 AND THE STAT/SEVR WILL BE # SET TO INVALID. THE INVALID STATE IS LOOKED # AT ON REBOOT BY THE RESTORE PROGRAM AND THE MBBO # WILL NOT BE RESTORED. SO IT'S VERY IMPORTANT TO DO # THE INITAL CAPUT. THIS METHOD ALSO WORKS FOR BOs. # NOTE THAT ANALOG OUTUPTS ARE ARE RESTORED IN THE # SAME MANNER SO THE VAL CAN BE RESTORED PROPERLY. # record(bo, "$(DEVICE):STDZMAINPS") { field(DESC, "Stdz by main or self") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "SELF") field(ONAM, "MAIN") } record(bo, "$(DEVICE):STDZPS") { field(DESC, "PS state after Stdz") field(PINI, "YES") field(ZNAM, "On") field(ONAM, "Off") field(DTYP, "Soft Channel") } # This pv is processed when starting and completing a standardize or degauss # function. At the start of each function the trims and/or related magnets are zeroed (2) # After the function has completed the trims and/or related magnets are trimmed (1). # # For strings with related magnets, such as trim coils or # nearby magents, specifed in the Magnet standardize PRD. # In this case, the string main the pv # STDZSLAVESGO is defined using the template # mgnt_string_ctrl.template, where the INP argument is set to # STDZGO.RVAL CPP, processing on change. record(mbbo, "$(DEVICE):STDZGO") { field(DESC, "Stdz trims") field(NOBT, "2") field(ZRST, "Ready") field(ONST, "TRIM") field(TWST, "DAC_ZERO") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "8") } record(bo, "$(DEVICE):STDZOK") { field(DESC, "Standarize Successful") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(DTYP, "Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(stringout, "$(DEVICE):STDZTOD") { field(DESC, "Successful Standardize Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "$(DEVICE):STDZLOSTTOD") { field(DESC, "Standardize Lost Time") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, " ") info(autosaveFields,"VAL") } record(longout, "$(DEVICE):STDZCYCLECNT") { field(DESC, "Cycle Count") field(PINI, "YES") } record(longout, "$(DEVICE):STDZCYCLENUM") { field(DESC, "No. Standardize Cycles") field(VAL, "0") field(HOPR, "10") field(LOPR, "0") field(DRVH, "10") field(DRVL, "0") field(PINI, "YES") field(FLNK, "$(DEVICE):STDZDIRECT") } # The default standardize direction is "UP" for # all LCLS Magnets.. record(bo, "$(DEVICE):STDZDIRECT") { field(DESC, "Standardize Direction ") field(ZNAM, "UP") field(ONAM, "DOWN") field(VAL, "0") field(FLNK, "$(DEVICE):STDZIMIN") } record(ao, "$(DEVICE):STDZIMIN") { field(DESC, "Min-STDZ Current") field(PREC, "1") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(VAL, "$(IMIN)") field(FLNK, "$(DEVICE):STDZIMAX") } record(ao, "$(DEVICE):STDZIMAX") { field(DESC, "Max. Standarize Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(VAL, "$(IMAX)") field(FLNK, "$(DEVICE):STDZIFINAL") } record(ao, "$(DEVICE):STDZIFINAL") { field(DESC, "Final SDTZ Current") field(DTYP, "Soft Channel") field(PREC, "1") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(VAL, "$(IMIN)") field(FLNK, "$(DEVICE):STDZSUB") } # Loose tolerance on desired current-ADC measured current. # used for calibration and standardize. This is an # absolute tolerance with the default set to 10 percent. # Note: in slc ATOL(1), absolute tolerance record(ao, "$(DEVICE):STDZITOLR") { field(DESC, "Stdz tolerance min") field(DTYP, "Soft Channel") field(PREC, "5") field(DRVL, "0.05") field(DRVH, "10.0") field(VAL, "0.1") field(EGU, "%") field(PINI, "YES") } # Loose tolerance on desired current-adc measured current. # used for calibration and standardize. The tolerance # is a percentage (INPC=5%) of the maximum current. Note that # we have bipolar supplies, so the absolute value of # the min and max current is taken. # Note: in slc ATOL(2), fractional tolerance record(calc, "$(DEVICE):STDZITOL") { field(DESC, "Stdz min tolerance") field(PREC, "5") field(CALC, "MAX(ABS(A),ABS(B))*C") field(INPA, "$(DEVICE):STDZIMIN CP NMS") field(INPB, "$(DEVICE):STDZIMAX CP MMS") field(INPC, "0.05") field(INPD, "$(DEVICE):STDZITOLR CP MMS") field(EGU, "A") field(FLNK, "$(DEVICE):IDELTAS") field(PINI, "YES") } # D - factor (3.154/2 = 1.577) for EPSC, otherwise, set to 1.0 record(calc, "$(DEVICE):STDZDLY") { field(DESC, "Ramp time for stdz cycle") field(CALC, "C>0?MAX(1,ABS((A-B)/C)*D):0") field(INPA, "$(DEVICE):STDZIMIN CP NMS") field(INPB, "$(DEVICE):STDZIMAX CP NMS") field(INPC, "$(DEVICE):TRIMRAMPRATE CP NMS") field(INPD, "1.0") field(PREC, "5") field(EGU, "sec") field(PINI, "YES") } record(calc, "$(DEVICE):STDZRAMPDLY") { field(DESC, "Ramp delay total") field(CALC, "MAX(1,((A/100)*B+B))") field(PREC, "5") field(INPA, "$(DEVICE):TRIMDLYPCT CP MS") field(INPB, "$(DEVICE):STDZDLY CP MS") field(EGU, "sec") } # Meeting 4/22/2011 Loos, Sullivan decided to wait 1 sec # Note: see note in mgntCtrl.st, mgntCtrl_settle_wait record(calc, "$(DEVICE):STDZMINIDLY") { field(DESC, "Mini-stdz delay") field(CALC, "A") field(PREC, "5") field(A, "1.0") field(EGU, "sec") field(PINI, "YES") } record(ao, "$(DEVICE):STDZMINIPCT") { field(DESC, "Mini Stdz percent") field(DTYP, "Soft Channel") field(VAL, "5.0") field(EGU, "%") field(PREC, "2") field(DRVH, "15.0") field(DRVL, "0.0") field(HOPR, "15.0") field(LOPR, "0.0") field(PINI, "YES") } record(calc, "$(DEVICE):STDZMINIDELTA") { field(DESC, "Stdz mini % of IMAX") field(CALC, "(B/100)*(A-C)") field(INPA, "$(DEVICE):IDES.HOPR") field(INPB, "$(DEVICE):STDZMINIPCT CPP NMS") field(INPC, "$(DEVICE):IDES.LOPR") field(PREC, "5") } record(calc, "$(DEVICE):STDZMINISETPT") { field(DESC, "Mini Stdz delta") field(CALC, "C==0?MAX(E-D,B):MIN(E+D,A)") field(INPA, "$(DEVICE):IDES.HOPR") field(INPB, "$(DEVICE):IDES.LOPR") field(INPC, "$(DEVICE):STDZDIRECT.RVAL") field(INPD, "$(DEVICE):STDZMINIDELTA") field(INPE, "$(DEVICE):IDES") field(PREC, "5") field(FLNK, "$(DEVICE):STDZMINISETPTOOR") } # This PV is 1 if STDZMINISETPT is out of range (greater than # IDES.HOPR or less than IDES.LOPR) and 0 otherwise. record(calc, "$(DEVICE):STDZMINISETPTOOR") { field(DESC, "Mini Stdz setpoint out of range") field(CALC, "C==0?(E-DA)") field(INPA, "$(DEVICE):IDES.HOPR") field(INPB, "$(DEVICE):IDES.LOPR") field(INPC, "$(DEVICE):STDZDIRECT.RVAL") field(INPD, "$(DEVICE):STDZMINIDELTA") field(INPE, "$(DEVICE):IDES") field(PREC, "5") } # DR 4/2011 add these 2 records for perturb slider # If currently standardized and we are moving opposite # to the direction of standardization, then clear STDZOK # and not the time that standardize was lost in STDZTOD. # However, if standardization has already been lost don't # change the standardize lost date or bother to clear STDZOK. # To enable STDZ, STDZDISABLE = 0 = Enabled # # AL 7/2022 lose standardize only if out of tolerance # AL 10/2022 do not lose standardize if IACT is invalid # AL 10/2023 lose standardize if turned off even if not # out of tolerance # # This PV is processed by :BCTRLGO and a change in :STATE record(calcout, "$(DEVICE):CHECKSTDZLOST") { field(DESC, "Check if stdz is lost") field(CALC, "(G=3||I=3)?0:C=1&&D=0&&((H=1&&A#B)||(E=0))?3:0") field(INPA, "$(DEVICE):IADJUST.RVAL") field(INPB, "$(DEVICE):STDZDIRECT.RVAL") field(INPC, "$(DEVICE):STDZOK.RVAL") field(INPD, "$(DEVICE):STDZDISABLE.RVAL") field(INPE, "$(DEVICE):STATE.RVAL CPP NMS") field(INPF, "$(DEVICE):ICTRL.RVAL") field(INPG, "$(DEVICE):STATE.SEVR") field(INPH, "$(DEVICE):BDELTAS.M") field(INPI, "$(DEVICE):IACT.SEVR") field(OUT, "$(DEVICE):STDZLOSTGO.SELN PP NMS") field(OOPT, "Transition To Non-zero") field(FLNK, "$(DEVICE):STDZLOSTGO") } record(seq, "$(DEVICE):STDZLOSTGO") { field(DESC, "Process lost stdz") field(SELM, "Mask") field(SELL, "$(DEVICE):CHECKSTDZLOST") field(DOL1, "1") field(DOL2, "0") field(LNK1, "$(DEVICE):STDZLOSTTOD.PROC") field(LNK2, "$(DEVICE):STDZOK PP") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND # Set by sequence during calibration. The values # ZRVL-EIST must match #defines in mgntCtrl.h record(mbbo, "$(DEVICE):CALBSTATE") { field(DESC, "Calibration State") field(PINI, "YES") field(ZRST, "Done") field(ONST, "Ramping") field(TWST, "Waiting") field(THST, "Not used") field(FRST, "Unavailable") field(FVST, "Ramp timeout") field(SXST, "Error") field(SVST, "Timeout") field(EIST, "Abort") field(VAL, "0") } # Set OMSL to closed_loop, and don't restore on boot for any ps controllers. # EPSC's have auto calibrate in the firmware and return the calibration state # MCOR's, Bulks and Pulsed Magnests don't use the dac calibration provided by the sequence # EMCOR's have good resolution and don't require the dac calibration provided the sequence. # Otherwise set OMSL to closed_loop for EPSCs and get value from controller. record(bo, "$(DEVICE):CALBOK") { field(DESC, "Successful Calibration") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") # field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # If CALBOK=1 AND Calibrate is enabled AND Calibrate SLOPE > 0 # then DOL1...DOL5 will be written to LNK1...LNK5 (0x1f=31) in CALB_SEQ. # Otherwise, DOL6...DOLA will be written to LNK6...LNKA (0x3c0=960) in CALB_SEQ # record(calcout, "$(DEVICE):CALBSET") { field(DESC, "Use DAC Calbration") field(SCAN, "10 second") field(CALC, "A&&(B==0)&&C?31:960") field(INPA, "$(DEVICE):CALBOK") field(INPB, "$(DEVICE):CALBDISABLE") field(INPC, "$(DEVICE):CALBSLOPE") field(OOPT, "On Change") field(OUT, "$(DEVICE):CALB_SEQ.SELN PP") } # Set LINR=NO_CONVERSION (0) or LINR=LINEAR (2) # If no conversion is used then RVAL=ASLO*VAL + AOFF to # convert from volts to dac counts # if linear is used then RVAL=ASLO*ESLO*VAL + AOFF + EOFF # record(seq, "$(DEVICE):CALB_SEQ") { field(DESC, "Output Calib Values") field(SELM, "Mask") field(SELL, "$(DEVICE):CALBSET") # # Use calibration values. # Set Power Supply Controller PVs # :VSETPT.DISA 0 Disable record processing # :VSETPT.ASLO :CALBSLOPE # :VSETPT.AOFF :CALBOFFFSET # :VSETPT.LINR 0 "NO CONVERSION" # :VSETPT.DISA 1 Enable record processing field(DOL1, "1") field(DOL2, "$(DEVICE):CALBSLOPE") field(DOL3, "$(DEVICE):CALBOFFSET") field(DOL4, "0") field(DOL5, "0") field(LNK1, "") field(LNK2, "") field(LNK3, "") field(LNK4, "") field(LNK5, "") # # Don't use calibration values. # Set Power Supply Controller PVs # :VSETPT.DISA 0 Disable record processing # :VSETPT.ASLO 0 # :VSETPT.AOFF 0 # :VSETPT.LINR 2 "LINEAR" # :VSETPT.DISA 1 Enable record processing field(DOL6, "1") field(DOL7, "0") field(DOL8, "0") field(DOL9, "2") field(DOLA, "0") field(LNK6, "") field(LNK7, "") field(LNK8, "") field(LNK9, "") field(LNKA, "") } record(stringout, "$(DEVICE):CALBTOD") { field(DESC, "Calibration Success Time") field(PINI, "YES") # field(DOL, "") field(OMSL, "supervisory") field(DTYP, "Soft Channel") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):CALBWAITTIME") { field(DESC, "Settle time per point") field(PINI, "YES") field(EGU, "sec") field(DRVH, "10.0") field(HOPR, "10.0") field(DRVL, "1.0") field(LOPR, "1.0") field(VAL, "1.0") } # Indicate if the linear square fit # used in calculating the dac slope and offset # was good (0 is worse case, while 1 is best). record(ao, "$(DEVICE):CALBGOODFIT") { field(DESC, "Calibration Fit Successful") field(PINI, "YES") field(HOPR, "1.0") field(DRVH, "1.0") field(EGU, "A") } # Calculated slope used to convert Volts to DAC Counts # When CALBOK=1 and CALBDISABLE=0 then # CALBSLOPE -> :VSETPT.ASLO # and NO CONVERSION is used # record(ao, "$(DEVICE):CALBSLOPE") { field(DESC, "Calc DAC Slope") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } # Calculated offset used to convert Volts to DAC Counts # When CALBOK=1 and CALBDISABLE=0 then # CALBSLOPE -> :VSETPT.AOFF # and NO CONVERSION is used # record(ao, "$(DEVICE):CALBOFFSET") { field(DESC, "Calc DAC Offset") field(PREC, "6") field(EGU, "Counts") field(PINI, "YES") } record(bo, "$(DEVICE):CALBUSEDEFAULT") { field(DESC, "Use default Offset") field(DTYP, "Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(PINI, "YES") field(VAL, "0") } # Default slope used in conversion from Volts to DAC Counts record(ao, "$(DEVICE):DACSLOPE") { field(DESC, "V to DAC slope") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "$(DEVICE):DACOFFSET") } # Default Offset used in conversion from Volts to DAC Counts record(ao, "$(DEVICE):DACOFFSET") { field(DESC, "V to DAC offset") field(PREC, "6") field(EGU, "V") field(DOL, "") field(OMSL, "supervisory") field(PINI, "YES") field(FLNK, "$(DEVICE):CALCDAC") } # Calculated DAC Counts from measured current IACT. # A = Setpoint I to V Slope # B = Setpoint I to V Offset # C = Measured Current # D = V to DAC Offset # E = V to DAC Offsest (0) record(calc, "$(DEVICE):CALCDAC") { field(DESC, "IACT to DAC Counts") field(CALC, "D=0?0:(((C*A)+B)-E)/D") field(INPA, "") field(INPB, "0.0") field(INPC, "$(DEVICE):IACT") field(INPD, "$(DEVICE):DACSLOPE") field(INPE, "$(DEVICE):DACOFFSET") field(EGU, "Counts") field(PREC, "6") } record(ao, "$(DEVICE):DAC") { field(DESC, "DAC Set point") field(EGU, "Counts") field(DOL, "") field(OMSL, "supervisory") field(PREC, "6") field(PINI, "YES") } record(ao, "$(DEVICE):CALBIMIN") { field(DESC, "Calibration Min Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "$(IMAX)") field(HOPR, "$(IMAX)") field(DRVL, "$(IMIN)") field(LOPR, "$(IMIN)") field(PREC, "3") field(EGU, "A") field(VAL, "0.0") field(FLNK, "$(DEVICE):CALBIMAX") } record(ao, "$(DEVICE):CALBIMAX") { field(DESC, "Calibration Max Setpoint") field(DTYP, "Soft Channel") field(PREC, "3") field(DRVH, "$(IMAX)") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(DRVL, "$(IMIN)") field(EGU, "A") field(VAL, "$(IMAX)") field(FLNK, "$(DEVICE):CALBSTEPNUM") } record(ao, "$(DEVICE):CALBIFINAL") { field(DESC, "Calibration Last Setpoint") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "3") field(EGU, "A") field(HOPR, "$(IMAX)") field(LOPR, "$(IMIN)") field(VAL, "0") } record(longout, "$(DEVICE):CALBSTEPNUM") { field(DESC, "No. of CALB steps") field(HOPR, "10") field(DRVH, "10") field(DRVL, "3") field(LOPR, "3") field(DOL, "6") field(OMSL, "closed_loop") field(FLNK, "$(DEVICE):CALBIDELTA") } record(calc, "$(DEVICE):CALBIDELTA") { field(DESC, "Step size for CALB") field(CALC, "C=0?0:ABS((A-B)/C)") field(INPA, "$(DEVICE):CALBIMAX") field(INPB, "$(DEVICE):CALBIMIN") field(INPC, "$(DEVICE):CALBSTEPNUM") field(EGU, "A") } # This is the current multiplier between # the current input and output. For example, # the maximum output current on an MCOR6 (6A) # would expect a maximum readback current of 12A, # the multiplier would be 2. # On the other hand, for an MCOR12, both the # maximum output current and input current are 12A, # the multiplier would be 1. record(calc, "$(DEVICE):CALBIMULT") { field(DESC, "IACT vs ISETPT mult") field(CALC, "C#0||A=0?1:ABS(B/A)") field(INPA, "$(PS)ISETPT.DRVH") field(INPB, "$(PS)IACT.HOPR") field(INPC, "$(DEVICE):PSCONTROLLER.RVAL CPP") field(EGU, "A") field(PINI, "YES") } # SNL dbputs DAC values here. 6-10 steps are possible. record(waveform, "$(DEVICE):CALBICTRLWF") { field(DESC, "ICTRL setpoint array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") } record(waveform, "$(DEVICE):DACWF") { field(DESC, "DAC count array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "$(DEVICE):DACSA") } # Used only for xygraph edm plot record(subArray, "$(DEVICE):DACSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "$(DEVICE):DACWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } # SNL dbputs Calulated DAC values from IACT using the measured # slope and offset. 6-10 steps are possible. record(waveform, "$(DEVICE):CALCDACWF") { field(DESC, "Calc DAC counts array") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "$(DEVICE):CALCDACSA") } # Used only for xygraph edm plot record(subArray, "$(DEVICE):CALCDACSA") { field(DESC, "Calc DAC counts") field(DTYP, "Soft Channel") field(INP, "$(DEVICE):CALCDACWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } # The points on the line. Used to calculate the residuals # calbywf[i] = calbslope * calbiactwf[i] + calboffset record(waveform, "$(DEVICE):CALBYWF") { field(DESC, "mx + b") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "$(DEVICE):CALBYSA") } # Used only for xygraph edm plot record(subArray, "$(DEVICE):CALBYSA") { field(DESC, "DAC counts") field(DTYP, "Soft Channel") field(INP, "$(DEVICE):CALBYWF") field(MALM, "10") field(NELM, "6") field(INDX, "0") field(FTVL, "DOUBLE") } record(waveform, "$(DEVICE):CALBIACTWF") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(NELM, "10") field(FTVL, "DOUBLE") field(FLNK, "$(DEVICE):CALBIACTSA") } # Used only for xygraph edm plot record(subArray, "$(DEVICE):CALBIACTSA") { field(DESC, "Actual current") field(DTYP, "Soft Channel") field(MALM, "10") field(NELM, "6") field(INP, "$(DEVICE):CALBIACTWF") field(INDX, "0") field(FTVL, "DOUBLE") field(FLNK, "$(DEVICE):CALBLIMITS") } # Check that measured current during calibration is within # tolerance. record(aSub, "$(DEVICE):CALBLIMITS") { field(DESC, "Calb tolerance check") field(INAM, "mgntCalbLimitsInit") field(SNAM, "mgntCalbLimits") # # Inputs: # A - is the number of points (npts) # B - is the Y-axis # C - is the X-axis # D - minimum current tolerance # E - maximum current tolerance # F - stdz absolute current tolerance on ides-iact # G - stdz fractional tolerance of max current # H - :VSETPT.ESLO - slope used to convert volts to dac counts # I - iact vs isetpt multiplier # field(INPA, "$(DEVICE):CALBSTEPNUM") field(INPB, "$(DEVICE):CALBIACTWF") field(INPC, "$(DEVICE):CALBICTRLWF") field(INPD, "0.5") field(INPE, "2.0") # Loose tolerance on desired current-ADC measured current. # used for calibration and standardize. This is an # absolute tolerance with the default set to 10 percent. # Note: in slc ATOL(1), absolute tolerance field(INPF, "$(DEVICE):STDZITOLR") # Loose tolerance on desired current-adc measured current. # used for calibration and standardize. The tolerance # is a percentage (INPC=5%) of the maximum current. Note that # we have bipolar supplies, so the absolute value of # the min and max current is taken. # Note: in slc ATOL(2), fractional tolerance field(INPG, "$(DEVICE):STDZITOL") field(INPH, "$(DEVICE):DACSLOPE") field(INPI, "$(DEVICE):CALBIMULT") field(FTA, "ULONG") field(FTB, "DOUBLE") field(FTC, "DOUBLE") field(FTD, "DOUBLE") field(FTE, "DOUBLE") field(FTF, "DOUBLE") field(FTG, "DOUBLE") field(FTH, "DOUBLE") field(NOB, "10") field(NOC, "10") # # Outputs: # VALA - in tolerance flag (1=ok, 0=bad) # VALB - current ratio # VALC - tolerance for calibrated dac y-intercept from linear sq. fit # VALD - tolerance for calibrated dac slope from linear sq. fit # field(FTVA, "ULONG") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") } # Linear Square Fit. This record is processed by the SNL record(aSub, "$(DEVICE):CALBFITLSQ") { field(DESC, "Linear Sq Fit") field(INAM, "subSysFitLSqInit") field(SNAM, "subSysFitLSq") # # Inputs: # A - is the number of points (npts) # B - is the Y-axis # C - is the X-axis # D - not used # E - not used # F - debug flag (1=debug mod, 0=normal mode) (optional) # field(INPA, "$(DEVICE):CALBSTEPNUM") field(INPB, "$(DEVICE):CALBIACTWF") field(INPC, "$(DEVICE):DACWF") field(INPF, "$(DEVICE):DEBUG.RVAL") field(FTA, "ULONG") field(FTB, "DOUBLE") field(FTC, "DOUBLE") field(FTF, "ULONG") field(NOB, "10") field(NOC, "10") # # Outputs: # VALA - the constant term (y-intecept) # VALB - the X-Coefficient (slope) # VALC - the measure of goodness of fit # field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(BRSV, "INVALID") } #! TextBox(TB7,980,160,1420,460,0,"Dialog",12,1,16777215,"Macros:\nDEV = PRIM:LOCA:UNIT\nEGU = Engineering Units \nDRVH, DRVL = High and Low Drive Limits\n NOTE: DRVH, DRVL same as IMMO in the SLC database\nHIHI, LOLO = High and Low Limits for \n Standardization and Calibration\n NOTE: HIHI, LOLO same as IMMS in the SLC database\nPREC = Precision (# after the decimal point)\nNOTE: ADEL is the same as ATOL[1] in the SLC database.\nHYST = Readback Alarm Hysterisis\nDVI1 = offset polynomial of DVI\nDVI2 = slop polynomial of DVI",null) #! TextBox(TB4,1560,420,2000,680,0,"Dialog",12,1,16777215,"The fields in the SLOPE and OFFSET records are used when \nconverting I to DAC counts using linear conversion, \nVAL = OFFSET + SLOPE * x\n\nThe sel records choose between the calculated (theoretical)\nhard-coded values, or the values measured from calibration.\nThe output of the sel records connect to the ESLO and EOFF\nDAC channels for MCOR type devices. Selection is governed by\nthe $(DEVICE)CALBOK record, which flinks to the sel records\n",null) #! TextBox(TB3,1000,100,1340,140,0,"Dialog",24,1,16777215,"Calibrated Devices\n",null) #! TextBox(TB1,1280,440,1480,540,0,"Dialog",12,1,16777215,"CALBGOODFIT is written to by the CALB SNL\nupon successful calibration.\n(CALBOK is also written to by the CALB SNSL\nupon sucessful calb.)",null) #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(dfanout, "$(DEVICE):DEGAUSINIT") { field(DESC, "Proc. Degauss PVs on boot") field(PINI, "YES") field(DOL, "1") field(OUTA, "$(DEVICE):DEGAUSIMIN.PROC PP") field(OUTB, "$(DEVICE):DEGAUSIMAX.PROC PP") field(OUTC, "$(DEVICE):DEGAUSTYPE.PROC PP") field(OUTD, "$(DEVICE):DEGAUSSTEP.PROC PP") field(OUTE, "$(DEVICE):MADNAME.PROC PP") field(OUTF, "$(DEVICE):PSTYPE.PROC PP") field(OUTG, "$(DEVICE):DEGAUSSUB.DISV PP") field(ASG, "Internal") } # Inputs: # A - Degauss minimum current, only used of E=Standard or Oscillating # B - Degauss maximum current, only used of E=Standard or Oscillating # C - Degauss type, (ref: element name in the LCLS Oracle Infrastructure) # Set to None unless :DEGUASMETHOD = Oscillating # D - Not used # E - Degauss method (0=None , 1=standard, 2=Oscillating, 3=not used) # F - Power Supply type (0=bipolar, 1=unipolar, 2=unipolar with polarity switch, 3=none) # G - Debug flag from the pv :DEBUG # # Degaussing is available for unipolar power supplies with a polarity switch. # There are three types of degausing procedures used, the most common is the # the Standard. This will generate a set of current set points that will ramp # the power supply first to 0, and then cycle the current from a minimum to # maximum current a number of times defined by the PVs, and then finally to 0 current # as the last setpoint. # # :DEGAUSCYCLENUM -- Note: oly used for standard degauss method # :DEGAUSIMIN # :DEGAUSIMAX # # Finally the power supply is turned off and the # degauss flaged as completed by setting the following PV. # # :DEGAUSOK (1=successfuly completed, 0=not degaussed) # # Note: currently only the BXHS, BXSS, BCXXL bend chicane magnets # in the LCLS undulator. These magents use the osicllating methiod # where a predefined set of points have been provided by # Magnet Measurements (MMF) for degaussing. # # :DEGAUSMETHOD (e.g. None, Standard , Oscillation ) # :DEGAUSTYPE (e.g. BXHS2, BXSS2, BCXXL2 ) # # Note: Degauss is not available for unipolar power supplies # without a polarity switch (DTYP=3) Check PV :PSTYPE # to determine the type of power supply. # record(aSub, "$(DEVICE):DEGAUSSUB") { field(DESC, "Degauss subroutine") field(INAM, "mgntDegaussInit") field(SNAM, "mgntDegauss") field(BRSV, "INVALID") field(INPA, "$(DEVICE):DEGAUSIMIN NPP NMS") field(INPB, "$(DEVICE):DEGAUSIMAX NPP NMS") field(INPC, "$(DEVICE):DEGAUSTYPE.RVAL NPP NMS") field(INPE, "$(DEVICE):DEGAUSMETHOD.RVAL NPP NMS") field(INPF, "$(DEVICE):PSTYPE NPP NMS") field(INPG, "$(DEVICE):DEBUG.RVAL NPP NMS") field(INPH, "$(DEVICE):DEGAUSSTEP NPP NMS") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTC, "ULONG") field(FTD, "ULONG") field(FTE, "ULONG") field(FTF, "USHORT") field(FTG, "ULONG") field(FTH, "DOUBLE") # Outputs: # OUTA: Degauss set point waveform # OUTB: Status (0=success,1=None,2=output wf too small,3=invalid ps type,4=invalid method) # OUTC: Deguass number of cycles, where one cycle is min to max. # The number of data points would be # bipolar supplies: (2*D)+2 # where the additional 2 points are the starting and ending points, which is 0. # unipolar supplies with a polarity switch: 2*D # # Note: the aSub record sets the NORD field of the # waveform record based on the value in NOVA. # field(OUTA, "$(DEVICE):DEGAUSWF PP") field(OUTB, "$(DEVICE):DEGAUSMSG PP") field(OUTC, "$(DEVICE):DEGAUSCYCLENUM PP") field(FTVA, "DOUBLE") field(FTVB, "USHORT") field(FTVC, "ULONG") field(NOVA, "60") # On boot disable this PV from processing. # Processing will be enabled by the pv # :DEGAUSINIT, after all input pvs # have been processed. field(DISV, "0") } # This is the degauss waveform generated by # the :DEGAUSSUB record(waveform, "$(DEVICE):DEGAUSWF") { field(DESC, "Degauss Setpts") field(NELM, "60") field(FTVL, "DOUBLE") } record(mbbo,"$(DEVICE):DEGAUSMSG") { field(DESC, "Degauss Status Msg") field(NOBT, "3") field(ZRST, "Success") field(ONST, "None") field(TWST, "Wf too small") field(THST, "PS is not bipolar") field(FRST, "Unknown Degauss Type") field(TWSV, "MINOR") field(THSV, "MAJOR") field(FRSV, "MAJOR") } # Using the default degauss method of "Standard" # number of full cycle is 1, which equals 4 data points # for a bipolar supply and 5 data points for a unipolar # supply with a polarity switch. For the method "Oscillating" # the default number of full cycles is 25, which equals # 52 data points. # Note: this pv is populated by :DEGAUSSUB record(longout, "$(DEVICE):DEGAUSCYCLENUM") { field(DESC, "No. Degauss Cycles") field(HOPR, "27") field(DRVH, "30") field(LOPR, "0") field(PINI, "YES") } # Number of full cycles done during the degauss # Note: This pv is set by the sequence mgntCtrl.st during # the degauss procedure. record(longout, "$(DEVICE):DEGAUSCYCLECNT") { field(DESC, "Degauss Cycle Count") field(PINI, "YES") } # The DEGAUSSLAVESGO pv is used to force processing of a set of related magnets as the first step # of degaussing the main. These related magnest, in this case the trim coils, are DAC_ZEROed, # the the main is degaussed, afterwhich the trim coils are TRIMmed to their BDES value, # the main is turned off and the DEGAUSOK flag set to true. # # NOTE: Only when the DEGAUSOK flag is false and the main is turned off, will a minor alarm # be set and the summary message (STATAMSG) indicate a degauss warning. # # When the main is turned on and the DEGAUSOK flag is set to false, this case is considered # a major alarm. Note that some ps have on/off control and others do not. For example, # QSM1 does not have on/off control and so the supply is left on after degaussing. # However, for HXRSS,SXRSS and 50B1 these do have on/off control and the check for degauss # lost is different. # record(bo, "$(DEVICE):DEGAUSOK") { field(DESC, "Degauss Successful") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # For a magnet hw configuration that does not permit # the ps to be turned off after degaussing, such as QSM1, # after degaussing the ps is set to zero Amps, and the # and as long as the b-field limit remains below # a limit BLIMIIT, the degauss is maintained. Otherwise, # the degauss will be lost. record(ao, "$(DEVICE):DEGAUSBLIMIT") { field(DESC, "B-field limit for degausok") field(DTYP, "Soft Channel") field(PINI, "YES") field(DRVH, "20") field(VAL, "0.06") field(PREC, "4") } record(ao, "$(DEVICE):DEGAUSIMIN") { field(DESC, "Min. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "$(IMAX)") field(LOPR, "-$(IMAX)") field(DRVH, "$(IMAX)") field(DRVL, "-$(IMAX)") field(VAL, "-$(IMAX)") } record(ao, "$(DEVICE):DEGAUSIMAX") { field(DESC, "Max. Degauss I") field(PREC, "1") field(EGU, "Amps") field(HOPR, "$(IMAX)") field(LOPR, "-$(IMAX)") field(DRVH, "$(IMAX)") field(DRVL, "-$(IMAX)") field(VAL, "$(IMAX)") } # Degauss type # # 0=None # 1=BCXH1 # 2=BCXSS1 # 3=BCXXL1 # 4=CRYO (Use data points from FERMI) # 5=XCPEPX1 # 6=BCXCBX13 # 7=BCXCBX21 # # Note: this pv is looked at in a function in # thie field: mgntApp/src/mgntSub.c record(mbbo,"$(DEVICE):DEGAUSTYPE") { field(DESC, "Type Degauss") field(DTYP, "Raw Soft Channel") field(NOBT, "3") field(ZRST, "None") field(ONST, "BCXHS1") field(TWST, "BCXSS1") field(THST, "BCXXL1") field(FRST, "CRYO") field(FVST, "XCPEPX1") field(SXST, "BCXCBX13") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(FRVL, "4") field(FVVL, "5") field(SXVL, "6") field(FLNK, "$(DEVICE):DEGAUSSUB") field(VAL, "0") } # Degauss method # None - Degauss not available. # Standard - cycle up/down beween min and max, for ncycles, # defined in :DEGAUSCYCLENUM # Oscillate - oscillate between min and max, from the outer # limits towards zero, using a specified step size, # defined in :DEGAUSSTEP. # If this is sent then :DEAUSTYPE will be used. # record(mbbo,"$(DEVICE):DEGAUSMETHOD") { field(DESC, "Method of Degauss") field(DTYP, "Raw Soft Channel") field(NOBT, "2") field(ZRST, "None") field(ONST, "Standard") field(TWST, "Oscillating") field(THST, "Unknown") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(VAL, "0") } # This is the degauss step size, which applies # to the degauss type,or method "Oscillating", # where the set of degauss points is generated # starting from 0, and oscillating been max and # min, decressing in step size towards zero. # and ending at zero. record(ao, "$(DEVICE):DEGAUSSTEP") { field(DESC, "Degauss step size") field(DOL, "0.88") field(EGU, "Amps") } # Change to DEGAUSIRAMPRATE # Need to change: psCtrl.h, # To change default for degauss ramp rate # use static restore file _static.cwConfig record(ao, "$(DEVICE):DEGAUSRAMPRATE") { field(DESC, "Degauss Ramp rate ") field(PINI, "YES") field(PREC, "3") field(EGU, "Amps/sec") field(HOPR, "30.0") field(DRVH, "30.0") field(DRVL, "0.001") field(LOPR, "0.001") field(VAL, "2") } # Settle time between step. If the degauss type # or method "Standard" then the settle time # will take place at the flat-top. If the # method is "Oscillating" or "File" then # the settle time after each step. record(ao, "$(DEVICE):DEGAUSSETL") { field(DESC, "Settle time after each step") field(DTYP, "Soft Channel") field(PINI, "YES") field(PREC, "1") field(EGU, "sec") field(DRVL, "0.5") field(LOPR, "0.5") field(DRVH, "60.0") field(HOPR, "60.0") field(VAL, "2") } record(stringout, "$(DEVICE):DEGAUSTOD") { field(DESC, "Successful Degauss Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(stringout, "$(DEVICE):DEGAUSLOSTTOD") { field(DESC, "Degauss Lost Time") field(DTYP, "Soft Channel") field(PINI, "YES") field(VAL, " ") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):DEGAUSTIME") { field(DESC, "Time to complete") field(PINI, "YES") field(EGU, "secs") field(OUT, "$(DEVICE):DEGAUSTIME_MIN.A PP") info(autosaveFields,"VAL") } record(calc, "$(DEVICE):DEGAUSTIME_MIN") { field(DESC, "Time to complete") field(CALC, "A?A/60:0") field(EGU, "min") info(autosaveFields,"VAL") } # For degaussed magnets set the bdes of the trim coils # to zero before degauss begins, so that after the degauss # is complete they are trimmed to zero. For degaussed magnets # with trim coils set the macros OUT1-4 to the following: # OUT1= :BDES PP # # For magnets that do not have degauss use the macro # OUTA-D setting to blank. record(dfanout, "$(DEVICE):DEGAUSGO") { field(DESC, "Set bdes of btrms to zero") field(ASG, "Internal") field(OUTA, "") field(OUTB, "") field(OUTC, "") field(OUTD, "") } # =========== CRYO ONLY =========== record(bo, "$(DEVICE):DEGAUSAUTO") { field(DESC, "Perform an auto-degauss") field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } # Set Max Current while Magent is degaussed # # If the requested current is greater than imax (absolute), # then the magnet will be trimmed and the imax updated to # the requested current. record(calcout, "$(DEVICE):DEGAUS_IMAX_CHECK") { field(DESC, "Check if imax shoud chg") field(CALC, "(C==4)&&(ABS(B)>ABS(A))?1:0") field(INPA, "$(DEVICE):DEGAUS_IMAX") field(INPB, "$(DEVICE):ISETPT") field(INPC, "$(DEVICE):DEGAUSTYPE.RVAL") field(OUT, "$(DEVICE):DEGAUS_IMAX_UPDATE.SELN") field(FLNK, "$(DEVICE):DEGAUS_IMAX_UPDATE") } record(seq, "$(DEVICE):DEGAUS_IMAX_UPDATE") { field(DESC, "Degauss IMAX Update") field(SELM, "Specified") field(DOL1, "$(DEVICE):ISETPT") field(LNK1, "$(DEVICE):DEGAUS_IMAX PP") } # Set the maximum current after a successful # degauss. This pv is updated by the # sequence. record(ao, "$(DEVICE):DEGAUS_IMAX") { field(DESC, "Max I set afer a degauss") field(EGU, "Amps") field(PINI, "YES") field(PREC, "6") field(HOPR, "$(IMAX)") field(LOPR, "-$(IMAX)") field(DRVH, "$(IMAX)") field(DRVL, "-$(IMAX)") field(VAL, "$(IMAX)") field(FLNK, "$(DEVICE):DEGAUS_IMAXPOL_CHECK") info(autosaveFields,"VAL,RVAL") } # Set the polarity if degauss_imax record(calcout, "$(DEVICE):DEGAUS_IMAXPOL_CHECK") { field(DESC, "Determine polarity of imax") field(CALC, "A>=0?0:1") field(INPA, "$(DEVICE):DEGAUS_IMAX") field(FLNK, "$(DEVICE):DEGAUS_IMAXPOL") } record(bo, "$(DEVICE):DEGAUS_IMAXPOL") { field(DESC, "Polarity of imax I") field(DTYP, "Raw Soft Channel") field(DOL, "$(DEVICE):DEGAUS_IMAXPOL_CHECK") field(OMSL, "closed_loop") field(ZNAM, "Positive") field(ONAM, "Negative") field(FLNK, "$(DEVICE):DEGAUS_ABSIMAX") info(autosaveFields,"VAL RVAL") } # This is the maximum absoulte current # that has been set after a degusss. # Once the degauss has been lost the # Absolute maximum current is no longer # tracked until a degauss has been performed, # at which point this pv will be reset. # 1. If the requested current is greater than 85% of # DEGAUSABSIMAX for a trim request, the trim # the trim proceeds normally and DEGAUSABSIMAX # woudl be updated to the new value. # # 2. However, if the requeted current is greater # than 85% of DEGAUSABSIMAX but less than DEGUSABSIMAX, # the magnetr would be trimmed normally but # DEGAUSABSIMAX will NOT be updated. # # 3. If the requested current is less than 85% of # DEGAUSABSIMAX or the polarity of the requested # current has changed, then a degauss would be done # automatically, which will take about 100 seconds. # The current would then be set to the desired value, # which would update Imax and the polarity setting if # it has changed. During the degauss cycle, there # should be some sort of indicator in EPICs that # this is occurring, and perhaps an option provided to abort it. # record(calc, "$(DEVICE):DEGAUS_ABSIMAX") { field(DESC, "Absolute Max. Degauss I") field(CALC, "ABS(A)") field(INPA, "$(DEVICE):DEGAUS_IMAX") field(PREC, "6") field(EGU, "Amps") field(HOPR, "$(IMAX)") field(LOPR, "-$(IMAX)") info(autosaveFields,"VAL RVAL") } # IACT Polarity record(calcout, "$(DEVICE):IACTPOL_CHECK") { field(DESC, "Determine IACT polarity") field(SCAN, "5 second") field(CALC, "ABS(A-B)>C?(A>=0?0:1):D") field(INPA, "$(DEVICE):IACT") field(INPB, "$(DEVICE):IACTPOL_CHECK.LA") field(INPC, "0.0001") field(INPD, "$(DEVICE):IACTPOL_CHECK.PVAL") field(OOPT, "On Change") field(FLNK, "$(DEVICE):IACTPOL") } record(bo, "$(DEVICE):IACTPOL") { field(DESC, "Polarity of IACT") field(DTYP, "Raw Soft Channel") field(ZNAM, "Positive") field(ONAM, "Negative") info(autosaveFields,"VAL RVAL") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND # ==================== USED BY NON-CRYO MAGNETS ONLY =================== # # There are different magnet hw configurations # that must be considered, when determining # when degauss is lost. # # Configruation type 1: ps reamin on after degaussing - Cryo Quads and QSM1 (decomissioned) # Configuration type 2: ps is turned off after degaussing - BXHS, BXSS, BCXXL #============================================================================== # # FOR CONFIGUATION TYPE 2: non-cryo quads # ------------------------ # Case 1: When the b-field is set above a limit :DEGAUSBLIMIT, # degauss is lost. # # - set :DEGAUSOK=NO - degauss ok status # - set :DEGAUSOK.ZSV=MINOR - degauss ok severity warning # - set :STATMSG.FVSV=MINOR - summary status, "Not Degaus'd" alarm # - set :STATMSG.FRSV=MAJOR - summary status, "Turned Off" alarm # # Case 2: When the main supply is turned on, degauss is lost. (Warning) # # - set :DEGAUSOK=NO - degauss ok status # - set :DEGAUSOK.ZSV=MINOR - degauss ok severity warning # - set :STATMSG.FVSV=MINOR - summary status, "Not Degaus'd" alarm # - set :STATMSG.FRSV=MAJOR - summary status, "Turned Off" alarm # # Case 3: if the main (bulk) ps is turned off and magnet was degaussed # successfully, then degauss is lost. # # - set :STATMSG.FVSV=MAJOR - summary status, "Not Degaus'd" alarm # - set :STATMSG.FRSV=MAJOR - sumamry status, "Turned Off" alarm # - set :DEGAUSOK.ZSV=MAJOR - degauss status NO severity # - set :DEGAUSOK=NO - degauss status # record(calcout,"$(DEVICE):DEGAUS_STATE_CHECK") { field(DESC, "Check Degauss lost") field(CALC, "D=3?0:A=0?1:B&&C?2:B&&(C=0)?3:(B+C)=0?4:0") field(INPA, "$(DEVICE):DEGAUSENABLE CP") field(INPB, "$(DEVICE):DEGAUSOK") field(INPC, "$(DEVICE):STATE CP") field(INPD, "$(DEVICE):STATE.SEVR") field(OUT, "$(DEVICE):DEGAUS_STATE_SEQ.SELN PP") field(ASG, "Internal") } record(seq, "$(DEVICE):DEGAUS_STATE_SEQ") { field(DESC, "Degauss State Sequence") field(SELM, "Specified") field(SELL, "$(DEVICE):DEGAUS_STATE_CHECK") field(LNK1, "$(DEVICE):DEGAUS_STATE_DISABLE.PROC PP") field(LNK2, "$(DEVICE):DEGAUS_STATE_LOST.PROC PP") field(LNK3, "$(DEVICE):DEGAUS_STATE_GOOD.PROC PP") field(LNK4, "$(DEVICE):DEGAUS_STATE_OFF.PROC PP") field(ASG, "Internal") } # If degauss disabled then # - set the status summary message alarm severit to # - "Turned Off" to MAJOR # - "Not Degaus'd" to MINOR # - set DEGUASOK=NO # - set DEGAUSOK.ZSV=NO_ALARM # # If this is the string main then also, # - set slaves status summary message "Turned Off" severity to MAJOR # # LNK=DEGAUSSLAVESGO.DOL PP # # The pv DEGAUSSLAVESGO must be created in the database substitutions file # for the main, instantianting mgnt_string_ctrl.template # specifying the string slaves in CH1-8.. # record(seq, "$(DEVICE):DEGAUS_STATE_DISABLE") { field(DESC, "Degauss not used") field(LNK1, "$(DEVICE):DEGAUSOK.ZSV") field(LNK2, "$(DEVICE):DEGAUSOK PP") # Set status summary msg "Turned Off" severity to MAJOR # Set status summary msg "Not Degaus'd" severity to MINOR field(DOL3, "2") field(DOL4, "1") field(DOL5, "2") field(LNK3, "$(DEVICE):STATMSG.FRSV") field(LNK4, "$(DEVICE):STATMSG.FVSV PP") field(LNK5, "") field(ASG, "Internal") } # If degauss is enabled, and the magnet was degaussed successfully # and the ps state was turned on(1), then degauss # has been lost. # # - set the status summary messages alarm severity for # - "Turned Off" to MINOR # - "Not Degaus'd" to MINOR # - set DEGAUSLOSTOD, this is done in sequence mgntCtrl.st # - set DEGAUSOK=NO # - set DEGAUSOK.ZSV=MINOR # # If this is the string main then also, # - set slaves status summary message "Turned Off" severity to MINOR # LNK=DEGAUSSLAVESGO.DOL PP # # The pv DEGAUSSLAVESGO must be created in the database substitutions file # that defines the main, by instantianting mgnt_string_ctrl.template # specifying the string slaves in CH1-8. # record(seq, "$(DEVICE):DEGAUS_STATE_LOST") { field(DESC, "Degauss lost and ps On") field(DOL1, "1") field(LNK1, "$(DEVICE):DEGAUSOK.ZSV") field(LNK2, "$(DEVICE):DEGAUSOK PP") # Set status summary msg "Turned Off" severity to MINOR # Set status summary msg "Not Degaus'd" severity to MINOR field(DOL3, "1") field(DOL4, "1") field(DOL5, "1") field(LNK3, "$(DEVICE):STATMSG.FRSV") field(LNK4, "$(DEVICE):STATMSG.FVSV PP") field(LNK5, "") field(ASG, "Internal") } # If degauss is enabled, the magnet is not degaussed, # and the ps state is 0(off), then: # # - set the status summary message alarm severity # - "Turned Off" to MAJOR # - "Not Degaus'd" to MAJOR # - set DEGAUSOK.ZSV=MAJOR # # If this is the string main then also, # - set slaves status summary message "Turned Off" severity to MAJOR # LNK=DEGAUSSLAVESGO.DOL PP # # The pv DEGAUSSLAVESGO must be created in the database substitutions file # that defines the main, by instantianting mgnt_string_ctrl.template # specifying the string slaves in CH1-8. # record(seq, "$(DEVICE):DEGAUS_STATE_OFF") { field(DESC, "Degaused lost and ps Off") field(DOL1, "2") field(LNK1, "$(DEVICE):DEGAUSOK.ZSV PP") # Set status summary msg "Turned Off" severity to MAJOR # Set status summary msg "Not Degaus'd" severity to MAJOR field(DOL2, "2") field(DOL3, "2") field(DOL4, "2") field(LNK2, "$(DEVICE):STATMSG.FRSV") field(LNK3, "$(DEVICE):STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } # Degauss is enabled, the magent was degaussed successfully, # and the ps state is 0 (off), then: # # Case 1: for non-cryo magnets(0x1e/30 dec) # - set the status summary message alarm severity # - "Turned Off" to to NO_ALARM # - "Not Degaus'd" to to MINOR # - set the DEGAUSOK.ZSV=MINOR # # Note: This LNK macro is no longer needed, so use default of blank. # If this is the string main then also, # - set slaves status summary message "Turned Off" severity to MINOR # LNK=DEGAUSSLAVESGO.DOL PP # # The pv DEGAUSSLAVESGO must be crated in the database substitutions file # that defines the main, by instantianting mgnt_string_ctrl.template # specifying the string slaves in CH1-8.. # # Case 2: for cryo magnets (1) # - set the status summary message alarm severity for: # "Not Degaus'd" to to MINOR # record(seq, "$(DEVICE):DEGAUS_STATE_GOOD") { field(DESC, "Degauss good") field(DOL1, "1") field(LNK1, "$(DEVICE):DEGAUSOK.ZSV PP") # Set status summary msg "Turned Off" severity to NO_ALARM # Set status summary msg "Not Degaus'd" severity to MINOR field(DOL3, "1") field(LNK2, "$(DEVICE):STATMSG.FRSV PP") field(LNK3, "$(DEVICE):STATMSG.FVSV PP") field(LNK4, "") field(ASG, "Internal") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(mbbo, "$(DEVICE):FUNC") { field(DESC, "$(DEVICE) Function") field(DTYP, "Raw Soft Channel") field(PINI, "NO") # Control functions # Note: SLIDING and FEEDBACK are obsolete field(ZRST, "READY") field(ONST, "SLIDING") field(TWST, "TRIM") field(THST, "CALIB") field(FRST, "STDZ") field(FVST, "DEGAUSS") field(SXST, "PERTURB") field(SVST, "DAC_ZERO") field(EIST, "RESET") field(NIST, "TURN_ON") field(TEST, "TURN_OFF") field(ELST, "SAVE_BDES") field(TVST, "LOAD_BDES") field(TTST, "UNDO_BDES)") field(FTST, "BACT_TO_BDES") field(FFST, "BCON_TO_BDES") # # Number representation for control function field(ZRVL, "0") field(ONVL, "0") field(TWVL, "0") field(THVL, "0") field(FRVL, "0") field(FVVL, "0") field(SXVL, "0") field(SVVL, "0") field(EIVL, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "$(BACTI)") field(FFVL, "0") field(OUT, "$(DEVICE):CTRL CA") } # :CTRL pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "$(DEVICE):CTRL") { field(DESC, "$(DEVICE) Control") field(PINI, "NO") field(ZRST, "Ready") field(ONST, "") field(TWST, "") field(THST, "") field(FRST, "") field(FVST, "") field(SXST, "") field(SVST, "") field(EIST, "") field(NIST, "") field(TEST, "") field(ELST, "") field(TVST, "") field(TTST, "") field(FTST, "") field(FFST, "") field(ZRVL, "0") field(ONVL, "0") field(TWVL, "0") field(THVL, "0") field(FRVL, "0") field(FVVL, "0") field(SXVL, "0") field(SVVL, "0") field(EIVL, "0") field(NIVL, "0") field(TEVL, "0") field(ELVL, "0") field(TVVL, "0") field(TTVL, "0") field(FTVL, "0") field(FFVL, "0") field(OUT, "$(DEVICE):SELECTEN.A PP") field(SDIS, "0") } # If a function has been selected set this unit to busy record(calcout, "$(DEVICE):SELECTEN") { field(DESC, "Control Select Enable") field(CALC, "A>0?1:A") field(FLNK, "$(DEVICE):BUSY") } # Set to FREE on IOC reboot record(bo, "$(DEVICE):BUSY") { field(DESC, "$(DEVICE) Ctrl Done") field(DOL, "$(DEVICE):SELECTEN") field(ZNAM, "FREE") field(ONAM, "BUSY") field(PINI, "YES") field(FLNK, "$(DEVICE):SELECT") } record(bo, "$(DEVICE):SELECT") { field(ZNAM, "NO") field(ONAM, "YES") field(ZSV, "NO_ALARM") field(OSV, "MAJOR") } record(bo, "$(DEVICE):ABORT") { field(ZNAM, "NO") field(ONAM, "YES") field(PINI, "YES") } # :CTRLSTATE pv is processed at boot in the # sequence mgntCtrl.st Processed in sequence # record(mbbo, "$(DEVICE):CTRLSTATE") { field(DESC, "$(DEVICE) Ctrl Status") field(ZRST, "Done") field(ONST, "Ramping") field(TWST, "Ramp Wait") field(THST, "Mini-stdz") field(FRST, "Unavailable") field(FVST, "Ramp Timeout") field(SXST, "Error") field(SVST, "Timeout") field(EIST, "Abort") field(NIST, "Disabled") field(TEST, "Feedback") field(ELST, "Settling") field(TVST, "Chg Polarity") field(TTST, "Tripped") field(FTST, "Turn Off wait") field(FFST, "Turn On wait") } #! Further lines contain data used by VisualDCT #! View(0,0,1.1) #! Record("$(DEVICE):CTRL",20,20,0,0,"$(DEVICE):CTRL") #! Field("$(DEVICE):CTRL.OUT",16777215,1,"$(DEVICE):CTRL.OUT") #! Link("$(DEVICE):CTRL.OUT","$(DEVICE):SELECTEN.A") #! Field("$(DEVICE):CTRL.VAL",16777215,1,"$(DEVICE):CTRL.VAL") #! Record("$(DEVICE):SELECTEN",321,381,0,0,"$(DEVICE):SELECTEN") #! Field("$(DEVICE):SELECTEN.A",16777215,0,"$(DEVICE):SELECTEN.A") #! Field("$(DEVICE):SELECTEN.FLNK",16777215,1,"$(DEVICE):SELECTEN.FLNK") #! Link("$(DEVICE):SELECTEN.FLNK","$(DEVICE):BUSY") #! Field("$(DEVICE):SELECTEN.VAL",16777215,1,"$(DEVICE):SELECTEN.VAL") #! Record("$(DEVICE):BUSY",623,274,0,0,"$(DEVICE):BUSY") #! Field("$(DEVICE):BUSY.DOL",16777215,0,"$(DEVICE):BUSY.DOL") #! Link("$(DEVICE):BUSY.DOL","$(DEVICE):SELECTEN.VAL") #! Field("$(DEVICE):BUSY.FLNK",16777215,1,"$(DEVICE):BUSY.FLNK") #! Link("$(DEVICE):BUSY.FLNK","$(DEVICE):SELECT") #! Record("$(DEVICE):SELECT",669,508,0,1,"$(DEVICE):SELECT") #! Record("$(DEVICE):FUNC",940,120,0,0,"$(DEVICE):FUNC") #! Field("$(DEVICE):FUNC.OUT",16777215,0,"$(DEVICE):FUNC.OUT") #! Link("$(DEVICE):FUNC.OUT","$(DEVICE):CTRL.VAL") #! Record("$(DEVICE):ABORT",193,41,0,0,"$(DEVICE):ABORT") #! Record("$(DEVICE):CTRLSTATE",369,34,0,0,"$(DEVICE):CTRLSTATE") #! TextBox(TB0,563,0,946,210,0,"Dialog",12,1,16777215,"Macros:\nDEV =PRIM:LOCA:UNIT\nSETL = Settling time before limit checking is reinstated\nPHY = for magnets: B\n = for phase and amplitude: P or A\nRAW = for magnets: I\n = for phase and amplitude: V \nMENU*= Name of ctrl menu item\nCALC=equation for associating menu item with its seq record; if no seq record, then associate with SNL\nINPA = 0 if no feedback for this magnet; $DEV:FBCKCTRL otherwise\nFIND=index of Feedback in CTRL menu",null) #! TextBox(TB8,3100,3340,3440,3460,0,"Dialog",12,1,16777215,"",null) #! TextBox(TB6,1104,136,1595,350,0,"Dialog",12,1,16777215,"HLApps, slc-aware code sets the mgnt function via FUNC.\nFUNC contains the hard-coded indices for every possible function.\nCTRL contains only those functions available for the device, and thus may have different indices device to device. The macros in FUNC map hard-coded function values used by clients other than EDM to the unique CTRL indices per device",null) #! TextBox(TB2,506,736,926,856,0,"Dialog",12,1,16777215,"$(DEVICE):SELECT is used for Multi-device selection.\nIt is enabled when associated $(DEVICE):CTRL is \"0\" (DONE).\nIt is disabled when associated $(DEVICE):CTRL other than DONE.\nWhen enabled, user can choose to include in a list.\nWhen a \"list\" command is issued, SNL sequences know to \ninclude this unit.",null) #! TextBox(TB18,2260,3400,2260,3400,0,"Dialog",12,1,16777215,"HOOK CTRLUNDOBDES UP TO\n \nWhen done testing SNL PERTURB!!",null) #! TextBox(TB1,12,681,392,921,0,"Dialog",12,1,16777215,"$(DEVICE):CTRL:\n Set by users to perform a series of steps.\n Only this IOC is allowed to set CTRL back to DONE after\n action is complete. CA security must be set to prevent\n users outside this IOC from changing CTRL if it is not \n in the DONE state.\n\n For complicated actions such as TRIM, CALIBRATE, and \n STANDARDIZE, a sequence running on this IOC will \n perform the action and reset CTRL.\n\n When a device is controlled by fast feedback, CTRL \n remains in the Feedback status state until the device is removed from fast feedback control. \n ",null) #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(calcout, "$(DEVICE):BCTRL_INIT") { field(DESC, "Process BCTRL on boot") field(PINI, "YES") field(CALC, "A=3?1:0") field(INPA, "$(DEVICE):BCTRL.SEVR") field(OUT, "$(DEVICE):BCTRL.PROC PP") field(OOPT, "Transition To Non-zero") } # Note: for a string slave set the ACT # macro to the following: # ACT=:IACTCALC MS record(sub, "$(DEVICE):BACT") { field(DESC, "Actual B") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "$(DEVICE):BACT") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(INPE, "$(DEVICE):IACTCALC MS") field(INPF, "$(DEVICE):BDELTAS PP") field(INPG, "100") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(HIHI, "$(BMAX)") field(LOLO, "$(BMIN)") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "$(BMAX)") field(LOW, "$(BMIN)") field(FLNK, "$(DEVICE):BACTFO") info(autosaveFields,"HYST") } # Outputs: # I = HIGH warning delta for ACT # J = LOW alarm delta for ACT # K = HIHI warning delta for MON # L = LOLO monitor alarm for MON # M = Out of trim tolerance flag if set to 1 # N = MPS Alarm delta # F = Multiple of ACT deltas used for MON deltas # this should be set to 0 for ps that don't have # an auxillary adc. # record(sSub, "$(DEVICE):BDELTAS") { field(DESC, "ACT and MON Deltas") field(INAM, "mgntInit") field(SNAM, "mgntPhyDeltas") field(EGU, "$(EG)") field(HOPR, "1") field(PREC, "7") field(BRSV, "INVALID") field(INPA, "$(DEVICE):BDES") field(INPB, "$(DEVICE):TRIMBTOL") field(INPC, "$(DEVICE):TRIMBTOLR") field(INPD, "$(DEVICE):CHCKBTOL") field(INPE, "$(DEVICE):CHCKBTOLR") field(F, "2.0") field(INPG, "30") field(INPH, "$(DEVICE):BACT.VAL") # # MPS absolute and relative tolerances field(INPP, "$(DEVICE):MPSBTOL") field(INPQ, "$(DEVICE):MPSBTOLR") field(FLNK, "$(DEVICE):BCONLIMITS") info(autosaveFields,"F") } # This record is processed by BDELTAS record(aSub, "$(DEVICE):BCONLIMITS") { field(DESC, "Config B-field Limits") field(INAM, "mgntInit") field(SNAM, "mgntBCONLimits") field(INPA, "$(DEVICE):BDES") field(INPB, "$(DEVICE):BDELTAS.I") field(INPG, "$(DEVICE):DEBUG.RVAL") field(FTA, "DOUBLE") field(FTB, "DOUBLE") field(FTG, "ULONG") field(OUTA, "$(DEVICE):BCON.HIGH") field(OUTB, "$(DEVICE):BCON.LOW") field(OUTC, "$(DEVICE):BCON.HIHI") field(OUTD, "$(DEVICE):BCON.LOLO PP") field(FTVA, "DOUBLE") field(FTVB, "DOUBLE") field(FTVC, "DOUBLE") field(FTVD, "DOUBLE") field(BRSV, "INVALID") field(FLNK, "$(DEVICE):IDELTAS") } # The following PV is processed by :BACT # which is processed by :BACT # record(fanout, "$(DEVICE):BACTFO") { field(DESC, "BACT processing") field(SELM, "All") field(LNK1, "$(DEVICE):BDIFF") field(LNK2, "$(DEVICE):BADIFF") field(LNK3, "$(DEVICE):BRATIO") field(LNK4, "$(DEVICE):MPSLIMITS") field(LNK5, "$(DEVICE):I2BSTATUS") field(LNK6, "$(DEVICE):IACTFO.PROC") } record(calc, "$(DEVICE):BDIFF") { field(DESC, "BDES-BACT") field(CALC, "A-B") field(INPA, "$(DEVICE):BDES") field(INPB, "$(DEVICE):BACT") field(EGU, "$(EG)") field(PREC, "7") } record(calc, "$(DEVICE):BADIFF") { field(DESC, "Absolute BDES-BACT") field(INPA, "$(DEVICE):BDIFF") field(EGU, "$(EG)") field(PREC, "7") field(CALC, "A<0?ABS(A):A") } record(calc, "$(DEVICE):BRATIO") { field(DESC, "BACT Error") field(CALC, "B?A/B:0") field(INPA, "$(DEVICE):BDIFF") field(INPB, "$(DEVICE):BDES.HOPR") field(EGU, "$(EG)") field(PREC, "7") } record(mbbi, "$(DEVICE):I2BSTATUS") { field(DESC, "Poly Convergence Status") field(NOBT, "16") field(ZRST, "Converged") field(ONST, "Almost Conv") field(TWST, "No Conv") field(THST, "Zero Slope") field(FRST, "Poly Error") field(ZRSV, "NO_ALARM") field(ONSV, "MINOR") field(TWSV, "MAJOR") field(THSV, "MAJOR") field(FRSV, "MAJOR") field(INP, "$(DEVICE):BACT.J") } # Note: for a string slave set the MONFL # macro to the following: # MONFL=:IMONCALC MS record(sub, "$(DEVICE):BMON") { field(DESC, "Second Transductor") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "$(DEVICE):BMON") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(INPE, "$(DEVICE):IMONCALC MS") field(INPF, "$(DEVICE):BDELTAS.VAL") field(INPG, "100") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(HIHI, "$(BMAX)") field(LOLO, "$(BMIN)") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "$(BMAX)") field(LOW, "$(BMIN)") } # for indivdual magnets and string main use the # default macors. For slaves set the macros # as follows for slaves w/o trim coils: # OMSL=closed_loop # DOL=$(PS)BDES CP record(ao, "$(DEVICE):BDES") { field(DESC, "Desired B-Field") field(PINI, "NO") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(EGU, "$(EG)") field(MDEL, "-1") field(OMSL, "closed_loop") field(DOL, "$(DEVICE):IDES2BDES") field(OUT, "$(DEVICE):B2IDES PP") info(autosaveFields,"VAL") } record(sub, "$(DEVICE):B2IDES") { field(DESC, "Convert Desired B-Field to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(PREC, "7") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(MDEL, "-1") field(INPE, "$(DEVICE):BDES.DRVH") field(INPF, "$(DEVICE):BDES.DRVL") field(BRSV, "INVALID") field(FLNK, "$(DEVICE):IDES") } record(sub, "$(DEVICE):BNOM") { field(DESC, "Nominal Field") field(PINI, "YES") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(INPE, "$(DEVICE):BDES.DRVH") field(INPF, "$(DEVICE):BDES.DRVL") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(VAL, "$(BNOM)") field(FLNK, "$(DEVICE):INOM") } record(sub, "$(DEVICE):BACTLIMITS") { field(DESC, "ACT Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "$(DEVICE):BDES.VAL") field(INPB, "$(DEVICE):BDES.DRVH") field(INPC, "$(DEVICE):BDES.DRVL") field(INPD, "$(DEVICE):BDELTAS.I") field(INPE, "$(DEVICE):BDELTAS.J") field(INPG, "$(DEVICE):STATE") field(INPH, "$(DEVICE):HSTA") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(BRSV, "INVALID") } record(sub, "$(DEVICE):BMONLIMITS") { field(DESC, "MON Limits") field(INAM, "mgntInit") field(SNAM, "mgntLimits") field(INPA, "$(DEVICE):BDES.VAL") field(INPB, "$(DEVICE):BDES.DRVH") field(INPC, "$(DEVICE):BDES.DRVL") field(INPD, "$(DEVICE):BDELTAS.K") field(INPE, "$(DEVICE):BDELTAS.L") field(INPG, "$(DEVICE):STATE") field(INPH, "$(DEVICE):HSTA") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(BRSV, "INVALID") } record(seq, "$(DEVICE):BLIMITS") { field(DESC, "ACT Limits") field(PREC, "7") field(DOL1, "$(DEVICE):BLIMITS") field(LNK1, "$(DEVICE):BACTLIMITS.F PP") field(DOL2, "$(DEVICE):BACTLIMITS.I") field(LNK2, "$(DEVICE):BACT.HIGH") field(DOL3, "$(DEVICE):BACTLIMITS.J") field(LNK3, "$(DEVICE):BACT.LOW") field(DOL4, "$(DEVICE):BACTLIMITS.K") field(LNK4, "$(DEVICE):BACT.HIHI") field(DOL5, "$(DEVICE):BACTLIMITS.L") field(LNK5, "$(DEVICE):BACT.LOLO") field(DOL6, "$(DEVICE):BLIMITS") field(LNK6, "$(DEVICE):BMONLIMITS.F PP") field(DOL7, "$(DEVICE):BMONLIMITS.I") field(LNK7, "$(DEVICE):BMON.HIGH") field(DOL8, "$(DEVICE):BMONLIMITS.J") field(LNK8, "$(DEVICE):BMON.LOW") field(DOL9, "$(DEVICE):BMONLIMITS.K") field(LNK9, "$(DEVICE):BMON.HIHI") field(DOLA, "$(DEVICE):BMONLIMITS.L") field(LNKA, "$(DEVICE):BMON.LOLO") field(FLNK, "$(DEVICE):ILIMITS") field(SCAN, "5 second") } record(ao, "$(DEVICE):BCTRL") { field(DESC, "B-Perturb") field(PREC, "7") field(EGU, "$(EG)") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") # The omsl field is set to open/closed loop # by the sequence mgntCtrl.st to dispable the # user from using the slider. # field(MDEL, "-1") field(FLNK, "$(DEVICE):BCTRLGO") info(autosaveFields,"VAL") } # Process IDIRECT upon a new IDES but prior to setting ISETPT # insert delay to give IDES a chance to update # Process IDIRECT directly instead of waiting for the # 0.5 sec process scan in the readback V to I to B chain. # When CHECKSTDZLOST is processed, IDIRECT will have processed # Then go on to act upon BCTRL by processing BCTRLSUB # record(seq, "$(DEVICE):BCTRLGO") { field(DESC, "Update DES and perturb") field(PREC, "7") # Disable BACT limits field(DOL1, "1") field(LNK1, "$(DEVICE):BLIMITS.VAL") # Update BDES with the BCTRL (slider) value field(DOL2, "$(DEVICE):BCTRL.VAL") field(LNK2, "$(DEVICE):BDES PP") field(DOL3, "1") field(LNK3, "$(DEVICE):IDIRECT.PROC PP") field(DOL4, "1") field(LNK4, "$(DEVICE):CHECKSTDZLOST.PROC PP") field(DOL5, "$(DEVICE):BCTRL.VAL") field(LNK5, "$(DEVICE):BCTRLSUB PP") # Re-enable BACT limits field(DOL6, "0") field(LNK6, "$(DEVICE):BLIMITS.VAL") } # Convert B-field to Current and output to ISETPT record(sub, "$(DEVICE):BCTRLSUB") { field(DESC, "Feedback") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(INPE, "$(DEVICE):BDES.DRVH") field(INPF, "$(DEVICE):BDES.DRVL") field(PREC, "7") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(MDEL, "-1") field(BRSV, "INVALID") field(FLNK, "$(DEVICE):ISETPT") } record(ao, "$(DEVICE):BDESPREVTRIM") { field(DESC, "trim bdes for undo") field(DTYP, "Soft Channel") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(PINI, "YES") info(autosaveFields,"VAL") } record(stringin, "$(DEVICE):MADNAME") { field(DESC, "MAD deck nomenclature") field(PINI, "YES") field(VAL, "$(M)") } record(ai, "$(DEVICE):Z") { field(DESC, "Z-Position") field(DTYP, "Soft Channel") field(EGU, "m") field(HOPR, "100000.0") field(LOPR, "0.0") field(PREC, "6") field(PINI, "YES") field(VAL, "$(S)") } record(ao, "$(DEVICE):BMAX") { field(DESC, "Max B-Field") field(DTYP, "Soft Channel") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(PINI, "YES") field(VAL, "$(BMAX)") field(FLNK, "$(DEVICE):BSTEP") } record(ao, "$(DEVICE):BMIN") { field(DESC, "Min B-Field") field(DTYP, "Soft Channel") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PREC, "7") field(PINI, "YES") field(VAL, "$(BMIN)") field(FLNK, "$(DEVICE):BSTEP") } record(ao, "$(DEVICE):BDESSAVE") { field(DESC, "bdes for save/load") field(DTYP, "Soft Channel") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(PINI, "YES") field(PREC, "7") } # This record is processed by $(DEVICE):BCONLIMITS # For slaves w/o trims this value is calcuated from the icon of the main # then passed backwards through the IVB poly. # For slave w/ trims this value is calcated from the icon of the main plus # the bcon if the trim, passed backwareds thought the IVB poly # For individual magnets or a main this value is entered. record(ao, "$(DEVICE):BCON") { field(DESC, "Config B-Field ") field(DTYP, "Soft Channel") field(PREC, "7") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") # Set MINOR Alarm as the default, slaves will set NO_ALARM=0. field(HHSV, "NO_ALARM") field(LLSV, "NO_ALARM") field(HSV, "NO_ALARM") field(LSV, "NO_ALARM") field(DOL , "$(DEVICE):ICON2BCON") field(OMSL, "closed_loop") field(OUT, "$(DEVICE):B2ICON PP") info(autosaveFields,"VAL") } record(sub, "$(DEVICE):B2ICON") { field(DESC, "Convert Desired ICon to Curr") field(ASG, "Internal") field(INAM, "mgntInitPoly") field(SNAM, "mgntPoly") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(PREC, "7") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(MDEL, "-1") field(INPE, "$(DEVICE):BCON.DRVH") field(INPF, "$(DEVICE):BCON.DRVL") field(BRSV, "INVALID") field(FLNK, "$(DEVICE):ICON") } # This pv calculates the step size for the BCTRL slider. # Currently, EDM does not allow for a PV to be used for the # step size, so these values must be entered manaully for # each slider for a device. # AL 11/2023 - Allow custom step size factor record(calc, "$(DEVICE):BSTEP") { field(DESC, "B-Field step size") field(CALC, "(C==3)||(D==3)?0:ABS(A-B)*0.005") field(INPA, "$(DEVICE):BMAX") field(INPB, "$(DEVICE):BMIN") field(INPC, "$(DEVICE):BMIN.SEVR") field(INPD, "$(DEVICE):BMAX.SEVR") field(EGU, "$(EG)") field(PINI, "YES") field(PREC, "7") } # These PVs enable or disable the BCTRL slider depending # on whether the magnet is online or not record(calcout,"$(DEVICE):BCTRLDISABLECALC") { field(DESC, "Calc for disabling BCTRL") field(ASG, "Internal") field(CALC, "A?2:1") field(INPA, "$(DEVICE):ONLINE CP") field(OUT, "$(DEVICE):BCTRLDISABLEFOUT PP") } record(fanout, "$(DEVICE):BCTRLDISABLEFOUT") { field(DESC, "Disable BCTRL fanout") field(SELM, "Specified") field(SELL, "$(DEVICE):BCTRLDISABLECALC") field(LNK1, "$(DEVICE):BCTRLDISABLE") field(LNK2, "$(DEVICE):BCTRLENABLE") } record(stringout, "$(DEVICE):BCTRLDISABLE") { field(DESC, "Disable BCTRL") field(DTYP, "Soft Channel") field(OUT, "$(DEVICE):BCTRL.ASG") field(VAL, "NOWRITE") field(FLNK, "$(DEVICE):BCTRLDISV_UPDATE") } record(stringout, "$(DEVICE):BCTRLENABLE") { field(DESC, "Enable BCTRL") field(DTYP, "Soft Channel") field(OUT, "$(DEVICE):BCTRL.ASG") field(VAL, "") field(FLNK, "$(DEVICE):BCTRLDISV_UPDATE") } record(calcout, "$(DEVICE):BCTRLDISV_UPDATE") { field(DESC, "Calc for updating BCTRL.DISV") field(ASG, "Internal") field(CALC, "A") field(INPA, "$(DEVICE):ONLINE") field(OUT, "$(DEVICE):BCTRL.DISV") } #! TextBox(TB4,340,2480,840,2980,0,"Dialog",12,1,16777215,"Macros:\nDEV = PRIM:LOCA:UNIT\nPHY = for magnets: B\n = for phase and amplitude: P or A\nRAW = for magnets: I\n = for phase and amplitude: V \nEGU = Engineering Units \nDRVH, DRVL =High and Low Drive Limits\n NOTE: DRVH same as BMAX in the SLC database. \n For correctors (bipolar power supplies), DRVL=-DRVH\n For quads, bends, sexts, etc (unipolar power supplies), DRVL = 0.\nPREC = Precision (# after the decimal point)\nADEL = Readback Archive Delta Amount\n Also used in the epsilon calculation and alarm limit calc.\n NOTE: ADEL same as TOLS[3] in the SLC database.\nWDEL = Warning Delta Amount used in the warning limit calc.\n NOTE: WDEL same as TOLS[1] in the SLC database.\nMDEL = Readback Monitor Delta Amount\nHYST = Readback Alarm Hysterisis\nMAD = MAD Deck Name\nAFRAC = Fraction of DES for epsilon calculation and alarm limit calc.\n NOTE: AFRAC same as TOLS[4] in the SLC database.\nWFRAC = Fraction of DES for warning limit calc.\n NOTE: WFRAC same as TOLS[2] in the SLC database.\nMFRAC = Fraction of ACT deltas for MON deltas\n NOTE: MFRAC same as TOLF in the SLC database.\nPIND = PERTURB menu index; rval gets set to 6 from this index\n\n",null) #! TextBox(TB3,340,3860,980,3900,0,"Dialog",18,1,16777215,"Controlled Devices - Physical Engineering Units Records",null) #! TextBox(TB2,4340,1980,4760,2420,0,"Dialog",12,1,16777215,"$(DEVICE):BACT and MON\n are processed via links from \n $(DEVICE):IACT (device raw value readback 1)\n and\n $(DEVICE):IMON (device raw value readback 2)\nThey back-calculate the physical readback value from\nraw readback value (\"reverse polynomial\"). Input:\nVAL = Initial guess for back calculation\nA = Not Used\nB = Number of polynomial coeffs from $(DEVICE):POLYCOEF\nC = First polynomial coefficient (offset if linear)\nD = Second polynomial coefficient (slope if linear)\nE = $(DEVICE):IACT or MON\nF = Epsilon to use in back-calculation\nG = # of interations to use in back-calculation\nDPVT = Pointer to polynomial coeff (set by mgntInitPoly)\n\nOuput:\nH = Previous guess\nI = Number of iterations\nJ = Convergence status\nK = Raw value corresponding to VAL\nL = Slope where converged \nVAL = Best Estimate Physical Value ",null) #! TextBox(TB1,1846,2087,2126,2327,0,"Dialog",12,1,16777215,"$(DEVICE):BDES\n is processed when set by CA users or \n $(DEVICE):BCTRL (which is set by high\n level apps to set DES and perturb). It forces \n processing of IDES. When fast \n feedback is on, this record is \n periodically updated and uses the value \n from the feedback controller received over the fcom network.\n\nNOTE: Setting DES does NOT update the\nhardware. This requires a second \ncommand to TRIM or PERTURB.",null) #! TextBox(TB0,2120,1960,2320,2080,0,"Dialog",12,1,16777215,"Keep the last BDES value that was trimmed for the undo command. Trim SNL will process",null) #! TextBox(TB10,1680,3380,2020,3500,0,"Dialog",12,1,16777215,"BCON\nTurns yellow (MINOR alarm) if it doesn't match BDES exactly.\nVAL = BCON\nINPA = BDES\nsub mgntBCONLimits sets HIGH, LOW, HIHI,LOLO\nto BDES",null) #! TextBox(TB9,1700,2540,1980,2660,0,"Dialog",12,1,16777215,"$(DEVICE):BFBCK\n is processed by fast feedback only when \n fast feedback is on. It is disabled when\n feedback is off. It forces processing of\n $(DEVICE):ISETPT which gets its \n input from the K field of this record when\n fast feedback is on.\n",null) #! TextBox(TB8,2040,2720,2320,3080,0,"Dialog",12,1,16777215," These subroutine records convert a \n desired physical unit value to raw units \n using linear or polynomial conversion.\n Input:\n VAL = Desired value in physical units.\n B = Number of polynomial coefficients \n ($(DEVICE):POLYCOEF)\n C = First coefficient (offset if linear)\n D = Second coefficient (slope if linear)\n E = High Drive Limit\n F = Low Drive Limit\n G = Fast feedback desired value\n H = Fast feedback disable (0), enable (1)\n DPVT = Pointer to polynomial coefficients \n set by mgntInitPoly \n Output:\n K = Desired Raw Value (polynomial(VAL)) \n L = Slope of the polynomial at this value\n",null) #! TextBox(TB7,2760,580,3080,720,0,"Dialog",12,1,16777215,"$(DEVICE):B*LIMITS and $(DEVICE):BLIMITS:\n Calculate alarm and warning limits based on \n deltas from $(DEVICE):BDELTAS and the DES \n value. Limits can be \"disabled\" (or set to drive \n limits) on several conditions (the device is off, \n setpoint is changing, deltas cannot be \n calculated due to bad inputs).\n ",null) #! TextBox(TB6,1326,1996,1814,2145,0,"Dialog",12,1,16777215,"$(DEVICE):BCTRL and CTRLGO:\nCTRL is set by high level apps to update DES and perturb. CTRL forces processing of CTRLGO and, if enabled, CTRLGO copies CTRL to DES and asks device control do a PERTURB_SLIDE. \nWhen feedback is ON, CTRLGO is disabled and CTRL is periodically processed. \nWhen feedback os OFF, CTRL is updated to BDES upon PERTURB, TRIM, etc\n (first set BCTRL to closed_loop, then back to supervisory)\nWhen any function is active, disable CTRLGO",null) #! TextBox(TB5,2500,3040,2840,3200,0,"Dialog",12,1,16777215,"$(DEVICE):BDELTAS:\n VAL = Difference used in reverse polynomial \n calculation for BACT and MON\n I = ACT Warning Delta (slc TOLMX)\n J = ACT Alarm Delta\n K = MON Warning Delta\n L = MON Alarm Delta\n M = out of tolerance (=\"1\")\n ",null) #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(ai, "$(DEVICE):MPSBTOLR") { field(DESC, "Relative mps tol") field(VAL, "2") field(PREC, "2") field(EGU, "%") field(HOPR, "10.0") field(LOPR, "0.0") field(PINI, "YES") } record(calc, "$(DEVICE):MPSBTOL") { field(DESC, "Absolute mps tol") field(EGU, "$(EG)") field(PREC, "2") field(CALC, "ABS(A)*0.02") field(INPA, "$(DEVICE):BMAX") field(PINI, "YES") } # # 21-Aug-2013: K. Luchini # Set channel access security so that users # cannot easily change values. record(ao, "$(DEVICE):MPSBMAX") { field(DESC, "MPS Max B-field") field(EGU, "$(EG)") field(PREC, "7") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(PINI, "YES") field(VAL, "$(BMAX)") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):MPSBMIN") { field(DESC, "MPS Min B-field") field(EGU, "$(EG)") field(PREC, "7") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(PINI, "YES") field(VAL, "$(BMIN)") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):MPSBLLIM") { field(DESC, "MPS Low Limit B-field") field(EGU, "$(EG)") field(PREC, "7") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(PINI, "YES") field(VAL, "$(BMIN)") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } record(ao, "$(DEVICE):MPSBLLIM2") { field(DESC, "MPS Low Limit #2 B-field") field(EGU, "$(EG)") field(PREC, "7") field(DRVH, "$(BMAX)") field(DRVL, "$(BMIN)") field(PINI, "YES") field(VAL, "$(BMIN)") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Set the default to Std record(mbbo, "$(DEVICE):MPSBITMASK") { field(DESC, "MPS Bitmask for tol check") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(NOBT, "2") field(ZRVL, "1") field(ONVL, "2") field(TWVL, "4") field(THVL, "8") field(ZRST, "Std") field(ONST, "V1") field(TWST, "V2") field(THST, "V3") field(VAL, "0") field(OUT, "$(DEVICE):MPSLIMITS.E PP") } record(aSub, "$(DEVICE):MPSLIMITS") { field(DESC, "MPS alarm check") field(INAM, "mgntInit") field(SNAM, "mgntMpsLimits") # # Inputs: # # A: Signals to monitor for MPS # 0 - NONE, No MPS monitoring for this magnet # 1 - PS ON # 2 - PS ON and BACT # B: Difference betweek BDES-BACT # C: Tolerance allowed (bact must be within this amount of bdes). # D: Actual field (BACT) # E: Bitmask of tolerance check algorithm # status: 1=ok 0=fault # bitNo # 0 if (bdes-bact) f) then INTOL_BMIN=true else INTOL_BMIN=false (only check if A=2) # 2 if (g < bact > h) then INTOL_BRANGE=true else INTOL_BRANGE=false # 3 if (bact > i) then INTOL_BMIN2=true else INTOL_BMIN2=false # Note: used to protect the undulator by preventing the huth stopper S2 # form being pulled if the electron beam energy is below this limit. # BAS brings beam to S2 at that energy (2.2Gev) but SXR does not want to run # below 3.3Gev. Email from RHI to Mboyes 10/16/2012 4:37pm. # # F: mps b-field lower limit # G mps b-field minimum # H: mps b-field maximum # I: mps b-field lower limit #3 # field(INPA, "$(DEVICE):MPS.RVAL") field(INPB, "$(DEVICE):BADIFF") field(INPC, "$(DEVICE):BDELTAS.N") field(INPD, "$(DEVICE):BACT") field(INPE, "$(DEVICE):MPSBITMASK.RVAL") field(INPF, "$(DEVICE):MPSBLLIM") field(INPG, "$(DEVICE):MPSBMIN") field(INPH, "$(DEVICE):MPSBMAX") field(INPI, "$(DEVICE):MPSBLLIM2") field(FTA, "ULONG") field(FTB, "DOUBLE") field(FTC, "DOUBLE") field(FTD, "DOUBLE") field(FTE, "ULONG") field(FTF, "DOUBLE") field(FTG, "DOUBLE") field(FTH, "DOUBLE") field(FTI, "DOUBLE") # Outputs: indicate which mps tolerance check failed (binary 0/1) # VALA = B-field within tol of (BDES-BACT) (1=ok,0=fault) # VALB = B-field is greater than F (1=ok,0=fault) # VALC = B-field is within G < bact > H =ok (1=ok,0=fault) # VALD = B-field is greater than I (1=ok,0=fault) field(OUTA, "$(DEVICE):INTOL.RVAL PP") field(OUTB, "$(DEVICE):INTOL_BMIN.RVAL PP") field(OUTC, "$(DEVICE):INTOL_BRANGE.RVAL PP") field(OUTD, "$(DEVICE):INTOL_BMIN2.RVAL PP") field(FTVA, "ULONG") field(FTVB, "ULONG") field(FTVC, "ULONG") field(FTVD, "ULONG") field(BRSV, "INVALID") field(ASG, "NOWRITE") } ############ Start MPS Tolerance PVs ###################### # 21-Aug-2013: K. Luchini # Changed from bi to bo records # so we can set closed loop, to restrict userse # from easily changing these vaules. # record(bo, "$(DEVICE):INTOL") { field(DESC, "BACT within MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "$(DEVICE):MPSLIMITS.VALA") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "$(DEVICE):INTOL_BMIN") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "$(DEVICE):MPSLIMITS.VALB") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "$(DEVICE):INTOL_BMIN2") { field(DESC, "MPS tol #2") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "$(DEVICE):MPSLIMITS.VALD") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } record(bo, "$(DEVICE):INTOL_BRANGE") { field(DESC, "MPS tol") field(DTYP, "Raw Soft Channel") field(OMSL, "closed_loop") field(DOL, "$(DEVICE):MPSLIMITS.VALC") field(ONAM, "OK") field(ZNAM, "FAULT") field(ZSV, "MAJOR") field(OSV, "NO_ALARM") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(calc, "$(DEVICE):CHCKITOL") { field(DESC, "Absolute Check I Tolerance") field(EGU, "A") field(FLNK, "$(DEVICE):TRIMITOL") field(CALC, "ABS(A*B)") field(INPA, "$(DEVICE):CHCKBTOL") field(INPB, "$(DEVICE):POLYCOEF.B") field(PREC, "9") } record(calc, "$(DEVICE):TRIMBTOL") { field(EGU, "$(EG)") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(DESC, "Absolute Trim Tolerance") field(CALC, "ABS(A)/2") field(INPA, "$(DEVICE):CHCKBTOL") field(FLNK, "$(DEVICE):CHCKITOL") } record(calc, "$(DEVICE):CHCKBTOL") { field(DESC, "Check absolute tolerance") field(EGU, "A") field(PREC, "9") field(HOPR, "1.0") field(LOPR, "0.0") field(FLNK, "$(DEVICE):TRIMBTOL") field(CALC, "MAX(ABS(A),ABS(C))*(B/1000000)") field(INPA, "$(DEVICE):BDES.HOPR") field(INPB, "$(DEVICE):STABILITY") field(INPC, "$(DEVICE):BDES.LOPR") } record(longout, "$(DEVICE):STABILITY") { field(DESC, "Long Term Stability") field(PINI, "YES") field(VAL, "100") field(EGU, "ppm") field(DRVH, "1000") field(DRVL, "100") field(HOPR, "1000") field(LOPR, "100") field(FLNK, "$(DEVICE):CHCKBTOL") } record(calc, "$(DEVICE):TRIMITOL") { field(DESC, "Absolute Trim I Tolerance") field(EGU, "$(EG)") field(CALC, "ABS(A*B)") field(INPA, "$(DEVICE):POLYCOEF.B") field(INPB, "$(DEVICE):TRIMBTOL") field(PREC, "9") } record(ai, "$(DEVICE):TRIMBTOLR") { field(DESC, "Relative trim tol") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } record(ai, "$(DEVICE):CHCKBTOLR") { field(DESC, "Relative chck tol") field(VAL, "0") field(PREC, "4") field(EGU, "%") field(HOPR, "1.0") field(LOPR, "0.0") field(PINI, "YES") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../../dbd/mgntSoft.dbd") #! DBDEND record(bo, "$(DEVICE):FBCKFCOM") { field(ZNAM, "CA") field(ONAM, "FCOM") field(DESC, "CA Mode") field(PINI, "YES") field(SDIS, "0") } record(bo, "$(DEVICE):PAU") { field(ZNAM, "NotConfigured") field(ONAM, "Configured") field(DESC, "PAU Present") field(PINI, "YES") field(SDIS, "0") field(FLNK, "$(DEVICE):PAUGO") } record(fanout, "$(DEVICE):PAUGO") { field(DESC, "PAU control") field(LNK1, "$(DEVICE):PAUSTOP") field(LNK2, "$(DEVICE):PAUSTART") } # Note the default is for no feedback in which # case the macro LNK=#. If there is feedback, # which requires an evr and the 2nd lan port # from the fcom subnet, then set LNK= record(seq, "$(DEVICE):PAUSTART") { field(DESC, "Setup for PAU On") field(SDIS, "$(DEVICE):PAU.RVAL") field(DISV, "0") field(DOL1, "0") field(DOL2, "0") field(DOL3, "1") field(DLY3, "1") # field(LNK1, "") # field(LNK2, "") # field(LNK3, "") } record(seq, "$(DEVICE):PAUSTOP") { field(DESC, "Setup for PAU Off") field(SDIS, "$(DEVICE):PAU.RVAL") field(DISV, "1") field(DOL1, "1") field(DOL2, "1") field(DOL3, "0") # field(LNK1, "") # field(LNK2, "") # field(LNK3, "") } # Change attribute to PSDEVNAME record(stringout, "$(DEVICE):MCORDEVNAME") { field(DESC, "PS device name") field(PINI, "YES") field(DTYP, "Soft Channel") field(VAL, "$(PS)") } #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "$(DEVICE):HSTASUB") { field(DESC, "Transform EPICS to SLC HSTA") field(SCAN, "2 second") field(INAM, "mgntInit") field(SNAM, "mgntHstaEncode") # Inputs: # A = not used # B = ps type 0=bipolar, 1=unipolar, 2=unipolar w/polarity switch, no pwr supply # C = ps turned off by operator 0=no, 1=yes # D = magnet configuration 0=main,1=string-slave,2=string-main. # E = ps catagory 0=small,1=intermediate,2=bulk,3=modulator,4=none. # F = Interlock status (0=OK, s1=FAULT) # J = PS On/Off state # # Outputs: # Z = SLC HSTA bitmask # field(INPB, "$(DEVICE):PSTYPE.RVAL") field(INPC, "$(DEVICE):TURNEDOFF.RVAL") field(INPD, "$(DEVICE):CONFIG.RVAL") field(INPE, "$(DEVICE):PSCATEGORY.RVAL") field(INPF, "$(DEVICE):INTLKSUMY") # For EF Correctors if set to 1 field(INPG, "$(DEVICE):AUTOCTRL.RVAL") field(INPJ, "$(DEVICE):OUTOFSERVICE.RVAL") field(INPL, "$(DEVICE):STATE.RVAL") # This pv flags matlab feedback control field(INPN, "$(DEVICE):FBCKENABLE.RVAL") # This pv flags pattern aware. field(INPO, "$(DEVICE):PAU") field(INPP, "$(DEVICE):CALBDISABLE.RVAL") field(INPQ, "$(DEVICE):PTRBDISABLE.RVAL") field(INPR, "$(DEVICE):TRIMDISABLE.RVAL") field(INPS, "$(DEVICE):STDZDISABLE.RVAL)") # added FBCK to HSTA, which flags fast feedback control field(INPT, "$(DEVICE):FBCK") field(INPU, "$(DEVICE):TRIMTYPE.RVAL") field(INPV, "$(DEVICE):STDZDIRECT.RVAL") field(INPW, "$(DEVICE):DEGAUSENABLE.RVAL") field(FLNK, "$(DEVICE):HSTA") } record(longin, "$(DEVICE):HSTA") { field(DESC, "HSTA from EPICS") field(INP, "$(DEVICE):HSTASUB") } # Only magnets with bipolary power supplies can be degaussed. record(bo, "$(DEVICE):DEGAUSENABLE") { field(DESC, "Degauss Enable") field(DTYP, "Raw Soft Channel") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(PINI, "YES") field(VAL, "0") info(autosaveFields,"VAL RVAL") } # This is currently only used for cryo magnets. # If the a the degauss is enabled and degauss # will be lost when upon a trim request, a # degauss will be preformed proir the trim # if this pv is enabled. record(bo, "$(DEVICE):DEGAUSAUTOENABLE") { field(DESC, "Auto DEGAUS Enable") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(VAL, "0") field(PINI, "YES") } # EPSC's have auto a calibration in firmware running continuously. # So for EPSC's the default is for calibration to be enabled. However, # For MCOR's the DAC calibration is performed in software (mgntCtrl.st) # record(bo, "$(DEVICE):CALBDISABLE") { field(DESC, "DAC Calb Disabled") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "1") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "$(DEVICE):PTRBDISABLE") { field(DESC, "Perturb Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "1") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "$(DEVICE):TRIMDISABLE") { field(DESC, "Trim Function") field(DTYP, "Raw Soft Channel") field(ZNAM, "Enabled") field(ONAM, "Disabled") field(VAL, "1") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } record(bo, "$(DEVICE):STDZDISABLE") { field(DTYP, "Raw Soft Channel") field(ZNAM, "NO") field(ONAM, "YES") field(DESC, "Standardize Function") field(VAL, "1") field(PINI, "YES") info(autosaveFields,"VAL RVAL") } # This PV has been replaced by $(DEVICE):FBCK. # Only the matlab feedback currently uses this PV as of 11/07/2012. # The feedback controller software only uses $(DEVICE):FBCK. # This PV should be replaced by $(DEVICE):FBCK in the matlab feedback # and removed from the magnets sequence mgntCtrl.st and database. # The matlab feeback should do the same thing as the feedback controller # software for non-fast feedback devices, which use the CA subnet and # note the fast-feedback subnet FCOM to control the magnets.. # record(bo, "$(DEVICE):FBCKENABLE") { field(DESC, "Feedback Enable") field(DTYP, "Raw Soft Channel") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(PINI, "YES") field(VAL, "0") info(autosaveFields,"VAL RVAL") } # Note: this pv iset seot to Enabled for # earth field correctors. record(bo, "$(DEVICE):AUTOCTRL") { field(DESC, "Automatically controlled") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") } record(bo, "$(DEVICE):OUTOFSERVICE") { field(DESC, "Device Offline flag") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(ZNAM, "In-Service") field(ONAM, "Out-of-Service") field(DOL, "$(PS)OUTOFSERVICE CPP NMS") field(OMSL, "closed_loop") field(FLNK, "$(DEVICE):ONLINECALC") info(autosaveFields,"VAL RVAL") } record(calcout,"$(DEVICE):ONLINECALC") { field(DESC, "Device online status") field(ASG, "Internal") field(CALC, "A?0:1") field(INPA, "$(DEVICE):OUTOFSERVICE NPP NMS") field(OUT, "$(DEVICE):ONLINE PP") } record(bo, "$(DEVICE):ONLINE") { field(DESC, "PS Online Status") field(DTYP, "Raw Soft Channel") field(ZNAM, "OFFLINE") field(ONAM, "ONLINE") field(OUT, "") } record(bo, "$(DEVICE):ONOFFCTRL") { field(DESC, "PS on/off ctrl avail") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") } record(bo, "$(DEVICE):RESETCTRL") { field(DESC, "PS fault reset ctrl avail") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") } record(bo, "$(DEVICE):NOANLGCTRL") { field(DESC, "No analog control of ps") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(ZNAM, "Disabled") field(ONAM, "Enabled") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") field(VAL, "0") } # This PV is modified by :STATSUB.U record(bo, "$(DEVICE):UNAVAIL") { field(DESC, "Not avail for control") field(DTYP, "Raw Soft Channel") field(SCAN, "Passive") field(PINI, "YES") field(ZNAM, "Available") field(ONAM, "Unavailable") field(ZSV, "NO_ALARM") field(OSV, "NO_ALARM") } record(bo, "$(DEVICE):PPS") { field(DESC, "Monitored by PPS") field(ONAM, "YES") field(ZNAM, "NO") field(PINI, "YES") field(ASG, "NOWRITE") info(autosaveFields,"VAL") } # 21-Aug-2013: K. Luchini # Set channel access security so that # users cannot easily enable/disable MPS. # This pv is need for binary status # pvs in magnet databases, which are # are accessd the MPS Link Node over # Channel Access. record(mbbo, "$(DEVICE):MPS") { field(DESC, "Monitored by MPS") field(PINI, "YES") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(ZRST, "NONE") field(ONST, "PSON_MON") field(TWST, "PSON_BACT_MON") field(NOBT, "2") field(ASG, "EOICDESK") info(autosaveFields,"VAL") } # Informational only. record(bo, "$(DEVICE):BCS") { field(DESC, "Monitored by BCS") field(ONAM, "YES") field(ZNAM, "NO") field(PINI, "YES") field(ASG, "NOWRITE") info(autosaveFields,"VAL RVAL") } # Please note that option 3 "NONE" is set for magnets # that are considered a slave in a string. record(mbbo, "$(DEVICE):PSTYPE") { field(DESC, "Power Supply Type") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(NOBT, "2") field(ZRST, "Bipolar") field(ONST, "Unipolar") field(TWST, "Unipolar_PolSW") field(THST, "NONE") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(VAL, "3") field(ASG, "NOWRITE") } record(mbbo, "$(DEVICE):PSCATEGORY"){ field(DESC, "Power Supply Category") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(NOBT, "3") field(ZRST, "Small") field(ONST, "Intermediate") field(TWST, "Bulk") field(THST, "Modulator") field(FRST, "NONE") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(FRVL, "4") field(FVSV, "INVALID") field(SXSV, "INVALID") field(VAL, "4") field(ASG, "NOWRITE") } record(mbbo, "$(DEVICE):PSCONTROLLER") { field(DESC, "Power Supply Controller") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(NOBT, "3") field(ZRST, "MCOR") field(ONST, "EMCOR") field(TWST, "EPSC") field(THST, "PLC") field(FRST, "BECKHOFF") field(FVST, "SERIAL") field(SXST, "NONE") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(FRVL, "4") field(FVVL, "5") field(SXVL, "6") field(SVVL, "7") field(SVSV, "INVALID") field(VAL, "6") field(ASG, "NOWRITE") } record(mbbo, "$(DEVICE):CONFIG") { field(DESC, "Magnet Configuration") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(NOBT, "2") field(ZRST, "Individual") field(ONST, "String") field(TWST, "String Main") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") field(THSV, "INVALID") field(VAL, "1") field(ASG, "NOWRITE") field(FLNK, "$(DEVICE):TRIMTYPE") } record(stringout, "$(DEVICE):MAIN") { field(DESC, "Magnet Main") field(ASG, "NOWRITE") field(PINI, "YES") field(DOL, "$(PS)MADNAME CPP NMS") field(OMSL, "closed_loop") field(VAL, " ") } record(calcout, "$(DEVICE):TURNEDOFFCALC") { field(DESC, "Check if ps turned off") field(SCAN, "10 second") field(CALC, "A?0:B?0:1") field(INPA, "$(DEVICE):STATE.RVAL") field(INPB, "$(DEVICE):INTLKSUMY.RVAL") field(OUT, "$(DEVICE):TURNEDOFF PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "$(DEVICE):TURNEDOFF") { field(DESC, "Supply Turned Off by User") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } # If PSs is on then clear Tripped flag. # Otherise, if the ps is off and the # the ps wasn't turned off intentionally, # then consider that the ps has tripped. record(calcout, "$(DEVICE):TRIPPEDCALC") { field(DESC, "Check if ps tripped") field(SCAN, "10 second") field(CALC, "A?0:B?1:0") field(INPA, "$(DEVICE):STATE.RVAL") field(INPB, "$(DEVICE):INTLKSUMY.RVAL") field(OUT, "$(DEVICE):TRIPPED PP") field(OOPT, "On Change") field(ASG, "Internal") } record(bo, "$(DEVICE):TRIPPED") { field(DESC, "Supply Tripped") field(PINI, "YES") field(ZNAM, "NO") field(ONAM, "YES") info(autosaveFields,"VAL RVAL") } record(ao, "$(DEVICE):PSONDLY") { field(DESC, "Turn On delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "20") } record(ao, "$(DEVICE):PSOFFDLY") { field(DESC, "Turn Off delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "10") } # Note: This pv is only used for EPSCs and EMCOR's # and 50b1 seems to like this set to 20 sec. record(ao, "$(DEVICE):RAMPSTARTDLY") { field(DESC, "Tansition to ramp delay") field(PINI, "YES") field(PREC, "4") field(EGU, "secs") field(VAL, "0") } ######### For PSTYPE=2 Only ############# record(mbbo, "$(DEVICE):REVSWSTATE") { field(DESC, "Reversing Switch Status") field(DTYP, "Raw Soft Channel") field(PINI, "YES") field(NOBT, "2") field(ZRST, "NORMAL") field(ONST, "REVERSE") field(TWST, "MOVING") field(THST, "Not Available") field(TWSV, "MINOR") field(ZRVL, "0") field(ONVL, "1") field(TWVL, "2") field(THVL, "3") # # If PSTYPE=2 (unipolar supply with polarity switch) # then change DOL=:REVSWSTATE field(DOL, "2") field(OMSL, "closed_loop") } record(bo, "$(DEVICE):REVSWSET") { field(DESC, "Reversing Switch Set") field(DTYP, "Raw Soft Channel") field(ZNAM, "NORMAL") field(ONAM, "REVERSE") field(PINI, "YES") } #! TextBox(TB0,1860,1540,2180,1600,0,"Dialog",12,1,16777215,"SLC aware code writes SLC HSTA to HSTACTRL",null) #! TextBox(TB5,1940,2160,2200,2280,0,"Dialog",12,1,16777215,"Macros:\nDEV = DEVICE:AREA:POSN\nDEVICE = BEND, QUAD, *COR, etc\nMGNT = MGNT\nAREA = area\nPOSN = position\n",null) #! TextBox(TB3,1880,2000,2300,2120,0,"Dialog",14,1,16777215,"HSTA - hardware status\n\nHSTACTRL contains HSTA from SLC\nHSTACTRLSUB parses significant bits \nHSTACTRLSEQ links to the control bo's - fill in later - only 3 connected now\n\n\n\n",null) #! TextBox(TB1,1880,1660,2180,1980,0,"Dialog",12,1,16777215,"$(DEVICE):HSTACTRLSUB \nDecode HSTACTRL & link to significant bo's:\ns \nOutputs:\nI - Completely Happy\nJ - Out of Service\nK - In Trouble\nL - Turned off by Operator\nM - Polarity Reversed\nN - Feedback Control\nO - Mini-Stdz Required(always mini-stdz on trim if stdz enabled)\nP - Calib Disabled\nQ - Perturb Disabled\nR - Trim Disabled\nS - Stdz Disabled\nT - No retry on Trim - hook to trimtype\nU - IVBUp(=o) down(=1)\nV - Shunt/booster \nW - No AUTO TRIM (not used)\n",null) #! Record("$(DEVICE):TURNEDOFF",3140,1907,0,1,"$(DEVICE):TURNEDOFF") #! Generated by VisualDCT v2.6 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND record(sSub, "$(DEVICE):STATSUB") { field(DESC, "Build STATus ") field(INAM, "mgntInit") field(SNAM, "mgntSlcStat") field(INPA, "$(DEVICE):BACT.STAT") field(INPB, "$(DEVICE):BDES.STAT") field(INPC, "$(DEVICE):IRIPL.STAT") field(INPD, "") field(INPE, "") # INPF is used to propagate BCON to lclshome for selective magnets. # if used for standard magnet set to :BCON.STAT # if used for EFC correctors set to :GapAct.STAT field(INPF, "") field(INPG, "$(DEVICE):BACT.SEVR") field(INPH, "$(DEVICE):BDES.SEVR") field(INPI, "$(DEVICE):IRIPL.SEVR") field(INPJ, "") field(INPK, "") # # INPL is used to propagate BCON to lclshome for selective magnets. # if used for standard magnet set to :BCON.SEVR # if used for EFC correctors set to GapAct.SEVR field(INPL, "") field(INPM, "$(DEVICE):STATE.RVAL") field(INPN, "$(DEVICE):STDZOK") field(INPO, "$(DEVICE):CALBOK") field(INPP, "$(DEVICE):OUTOFSERVICE.RVAL") field(INPQ, "$(DEVICE):CONFIG.RVAL") field(INPR, "$(DEVICE):HSTA") field(INPS, "$(DEVICE):CTRL.RVAL") field(INPT, "$(DEVICE):DEGAUSOK") field(INPV, "$(DEVICE):INTLKSUMY") # # INPY is used to for kicker trigger status. If the kicker plc # has disabled trigger to the modulator, the ps can still be on # and trimmed nothing is being sent out to the magnet. # So the default is the TRIG macro is blank, unless this is a kicker # that has a trigger status. field(INPY, "") # Outputs # U - Input to UNAVAIL via UNAVAILGO seq record # W = worst STAT (BACT,BDES,RIPL,ISETPT,IACT,BCON) # X = worst SEVR (BACT,BDES,RIPL,ISETPT,IACT,BCON) field(SCAN, "2 second") field(PINI, "YES") field(FLNK, "$(DEVICE):STAT") } record(longout, "$(DEVICE):STAT") { field(DESC, "STAT sent to SLC") field(SCAN, "Passive") field(FLNK, "$(DEVICE):STATCTRLSUB") field(DOL, "$(DEVICE):STATSUB.VAL") field(OMSL, "closed_loop") } record(sSub, "$(DEVICE):STATCTRLSUB") { field(DESC, "Decode SLC STAT into mbbo") field(INAM, "mgntInit") field(SNAM, "mgntStatDecode") field(INPA, "$(DEVICE):STAT") field(INPB, "$(DEVICE):HSTA") field(INPD, "$(DEVICE):ONOFFCTRL.RVAL") field(FLNK, "$(DEVICE):STATMSG") } record(mbbo, "$(DEVICE):STATMSG") { field(DESC, "Status Message - worst case") field(NOBT, "16") field(ZRST, "Good") field(ONST, "BCON Warning") field(TWST, "Offline") field(THST, "PAU Ctrl") field(FRST, "Turned Off") field(FVST, "Not Degaus'd") field(SXST, "Not Cal'd") field(SVST, "Feedback Ctrl") field(EIST, "PS Tripped") field(NIST, "DAC Error") field(TEST, "ADC Error") field(ELST, "Not Stdz'd") field(TVST, "Out-of-Tol") field(TTST, "BAD Ripple") field(FTST, "BAD BACT") field(FFST, "No Control") field(ZRSV, "NO_ALARM") field(ONSV, "MINOR") field(TWSV, "NO_ALARM") field(THSV, "MINOR") field(FRSV, "MAJOR") field(FVSV, "MINOR") field(SXSV, "MINOR") field(SVSV, "NO_ALARM") field(EISV, "MAJOR") field(NISV, "MAJOR") field(TESV, "MAJOR") field(ELSV, "MINOR") field(TVSV, "MAJOR") field(TTSV, "MINOR") field(FTSV, "MAJOR") field(FFSV, "NO_ALARM") field(OMSL, "closed_loop") field(FLNK, "$(DEVICE):UNAVAILGO") field(DOL, "$(DEVICE):STATCTRLSUB.W") } record(seq, "$(DEVICE):UNAVAILGO") { field(DESC, "Process UNAVAIL") field(DOL1, "$(DEVICE):STATSUB.U") field(LNK1, "$(DEVICE):UNAVAIL PP") } record(stringout, "$(DEVICE):SNLSTATMSG") { field(DTYP, "Soft Channel") } #! TextBox(TB0,820,1000,1200,1220,0,"Dialog",12,1,16777215,"$(DEVICE):STATUSSUB - future\nOverall device status - takes input from action snls, record sevrs, master snl(s) and outputs final status\n\nInputs:\nA - $(DEVICE):CTRLSTATUS - snl status\nB - MGNT:CTRLSTATUS - master list status\nC\nD - $(DEVICE):SEVRSTATUS (future)",null) #! TextBox(TB9,1300,900,1680,1140,0,"Dialog",12,1,16777215,"STATDECODE is used for HSTA/STAT\nDiagnostic Display only",null) #! TextBox(TB8,1360,960,1540,1260,0,"Dialog",12,1,16777215,"Inputs:\nA - STAT\nOutputs:\nH - STAT_GOOD\nI - STAT_OK\nJ - STAT_DEAD\nK - STAT_SICK\nL - STAT_OFF\nM - STAT_STDZOK\nN - STAT_CALOK\nO - STAT_DRIFTING\nP - STAT_DBERR\nQ - STAT_DACERR\nR - STAT_ADCERR\nS - STAT_BADCUR\nT - STAT_OUTTOL\nU - STAT_BADRIPL\nV - STAT_BADBACT",null) #! TextBox(TB5,1680,960,1960,1080,0,"Dialog",18,1,16777215,"Macros:\nDEV = DEVICE:AREA:POSN\nDEVICE = BEND, QUAD, *COR, etc\nMGNT = MGNT\nAREA = area\nPOSN = position\n",null) #! TextBox(TB3,800,1180,1320,1300,0,"Dialog",14,1,16777215,"STAT - slc aware\n\nSTATSUB formats control bo's into STAT for SLC\nSTATSUBSEQ gets STATSUB outputs to STAT \n\n\n",null) #! TextBox(TB2,780,620,980,1000,0,"Dialog",12,1,16777215,"$(DEVICE)STATSUB\nformat control bo's into slc STAT\n\nInputs:\nA - $(DEVICE):STATUS\nC - $(DEVICE):ON\nD - $(DEVICE):STDZOK\nE - $(DEVICE):CALBOK\nF - $(DEVICE):BACTDRIFT (future)\nG -\nH- $(DEVICE):DACSTATUS\nI -$(DEVICE):ADCSTATUS\nJ - $(DEVICE):BACTSTATUS\nK - $(DEVICE):BDESSTATUS\nL - $(DEVICE):RIPLSTATUS\n\nOutput:\nP - $(DEVICE):STAT - slc STAT\n",null) #! TextBox(TB1,1520,680,1980,840,0,"Dialog",12,1,16777215,"Note:\nThere will most likely be a sub record for each of:\nADC record's .SEVR and .STAT -> ADCSTATUS\nDAC record's .SEVR and .STAT -> DACSTATUS\nBACT record's .SEVR and .STAT -> BACTSTATUS\nBDES record's .SEVR and .STAT -> BDESSTATUS\n?RIPL record's .SEVR and .STAT -> RIPLSTATUS\n -- above is all done in STATSUB",null) record(ao, "$(DEVICE):PROGRESS") { field(DESC, "Function Progress") field(VAL, "0") field(EGU, "percent") field(DRVH, "100") field(DRVL, "0") field(HOPR, "100") field(LOPR, "0") } record(bo, "$(DEVICE):DEBUG") { field(ZNAM, "OFF") field(ONAM, "ON") field(PINI, "YES") } # # Used by higher level software to determine how to use PVs associated # with the device. This record is manually set by operations when the # state of the device changes. # For example: Ops thinks the device is broken in some way. # They write an Artemis and put the device in MAINTENANCE. # The hardware guys fix the problem, solve the Artemis and put the # device in CHECKOUT. Ops decides whether the device is working and # either marks it ONLINE or back to MAINTENANCE. # record(mbbo, "$(DEVICE):ACCESS") { field(DESC, "Usage Mode") field(PINI, "YES") # Online - this device is operational, working normally, and ready to # be used by higher level software. field(ZRST, "Online") field(ZRSV, "NO_ALARM") # Maintenance - this device is in a maintenance state (being worked on by # controls) where maintainers can see how it is performing, but should not # be used by most higher level software. field(ONST, "Maintenance") field(ONSV, "MINOR") # Checkout - This device has had maintenance work done and is back in # production for 'check out' purposes by operations before it's released # for normal use. Some higher level software may use it. field(TWST, "Checkout") field(TWSV, "MINOR") # Offline - device is broken and should not be used by any higher level # software. field(THST, "Offline") field(THSV, "MAJOR") } # # Used by higher level software to determine if a PV is in feedback or not. # May also be used by actuator (magnet and RF) IOC applications to # switch output records to "closed_loop" to prevent outside programs from # changing setpoints when an actuator device is in feedback. # record(mbbo, "$(DEVICE):FBCK") { field(DESC, "Feedback State") field(PINI, "YES") field(VAL, "2") # Off - this device can be used in feedback but all feedback loops # using it are off. field(ZRST, "Off") # On - this device is being used by one or more feedback loops. field(ONST, "On") # Unavailable - this device is not used by any feedback loop. field(TWST, "Unavailable") } #! Generated by VisualDCT v2.5 #! DBDSTART #! DBD("../../../dbd/mgntSoft.dbd") #! DBDEND # Calcuate the field of a slave with a power trim coil # equal to the main desired current + trim bdes, which # is acutally amps. record(calcout, "$(DEVICE):IDESTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "$(EG)") field(PREC, "7") field(INPA, "$(PS)IDES CP NMS") field(INPB, "$(TRIM)BDES CP NMS") field(OUT, "$(DEVICE):IDES2BDES.E PP") } record(sub, "$(DEVICE):IDES2BDES") { field(DESC, "Cal BDES") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "$(DEVICE):IDES2BDES") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(INPE, "$(DEVICE):IDESTOTAL MS") field(INPF, "$(PS)BDELTAS PP") field(INPG, "100") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(HIHI, "$(BMAX)") field(LOLO, "$(BMIN)") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "$(BMAX)") field(LOW, "$(BMIN)") field(FLNK, "$(DEVICE):BDES") info(autosaveFields,"HYST") } # Calcuate the current of a slave with a power trim coil # equal to the main current + trim field (curent). This # total is passed backwards through the IVB poly. record(calcout, "$(DEVICE):IACTCALC"){ field(DESC, "Calc total act current") field(CALC, "A+B") field(EGU, "$(EG)") field(PREC, "7") field(INPA, "$(DEVICE):IACT CP NMS") field(INPB, "$(TRIM)BACT") field(OUT, "$(DEVICE):BACT.E PP MS") } # Calcuate the current of a slave with a power trim coil # equal to the main current + trim field (curent). This # total is passed backwards through the IVB poly. record(calcout, "$(DEVICE):IMONCALC"){ field(DESC, "Calc total mon current") field(CALC, "A+B") field(EGU, "$(EG)") field(PREC, "7") field(INPA, "$(DEVICE):IMON CP NMS") field(INPB, "$(TRIM)BMON") field(OUT, "$(DEVICE):BMON.E PP MS") } # Calcuate the b-con of a slave with a power trim coil # equal to the main desired current + trim bdes, which # is acutally amps. record(calcout, "$(DEVICE):ICONTOTAL"){ field(DESC, "Calc total current") field(CALC, "A+B") field(EGU, "$(EG)") field(PREC, "7") field(INPA, "$(PS)ICON CP NMS") field(INPB, "$(TRIM)BCON CP NMS") field(OUT, "$(DEVICE):ICON2BCON.E PP") } record(sub, "$(DEVICE):ICON2BCON") { field(DESC, "Cal BCON") field(INAM, "mgntInitPoly") field(SNAM, "mgntReversePoly") field(INPA, "$(DEVICE):ICON2BCON") field(INPB, "$(DEVICE):POLYCOEF") field(INPC, "$(DEVICE):POLYCOEF.A") field(INPD, "$(DEVICE):POLYCOEF.B") field(INPE, "$(DEVICE):ICONTOTAL MS") field(INPF, "$(PS)BDELTAS PP") field(INPG, "100") field(EGU, "$(EG)") field(HOPR, "$(BMAX)") field(LOPR, "$(BMIN)") field(HIHI, "$(BMAX)") field(LOLO, "$(BMIN)") field(PREC, "7") field(BRSV, "INVALID") field(HHSV, "MAJOR") field(HSV, "MINOR") field(LSV, "MINOR") field(LLSV, "MAJOR") field(HIGH, "$(BMAX)") field(LOW, "$(BMIN)") field(FLNK, "$(DEVICE):BCON") }